Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-4955 Support broker properties from JSON files #5120

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

brusdev
Copy link
Member

@brusdev brusdev commented Jul 31, 2024

No description provided.

@gemmellr
Copy link
Member

gemmellr commented Jul 31, 2024

I think it could be nicer to use an extension=type setup to convey what type of config is being used, rather than using broker.properties files for different types of config, so e.g. perhaps broker.json in this case. Seems more obvious for now in terms of what is being used at any given time, and more open to addition later for other specific types at some point? E.g. think of the log4j config as example.

@brusdev
Copy link
Member Author

brusdev commented Jul 31, 2024

@gemmellr your suggestion sounds good to me. I have just pushed a commit to implement that.

@gemmellr gemmellr merged commit 4d8ccc4 into apache:main Aug 1, 2024
8 checks passed
Comment on lines +586 to +599
private void parseFileProperties(File file) throws Exception {
InsertionOrderedProperties brokerProperties = new InsertionOrderedProperties();
try (FileReader fileReader = new FileReader(file);
BufferedReader reader = new BufferedReader(fileReader)) {
if (file.getName().endsWith(".json")) {
brokerProperties.loadJson(reader);
} else {
brokerProperties.load(reader);
}
}

parsePrefixedProperties(this, file.getName(), brokerProperties, null);
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brusdev we don't have an openapi definition for the broker properties atm, but when we start to having one, we could easily add a validation step upon reading the file to ensure that any properties we're loading is valid according to the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants