-
Notifications
You must be signed in to change notification settings - Fork 948
ARTEMIS-5871 restrict reload of properties config to the set of reloa… #6205
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4682,22 +4682,28 @@ public void reloadConfigurationFile() throws Exception { | |
| } | ||
|
|
||
| private void reloadConfigurationFile(URL xmlConfigUri) throws Exception { | ||
| Configuration config = new ConfigurationImpl(); | ||
| if (xmlConfigUri != null) { | ||
| Configuration config = new FileConfigurationParser().parseMainConfig(xmlConfigUri.openStream()); | ||
| config = new FileConfigurationParser().parseMainConfig(xmlConfigUri.openStream()); | ||
| LegacyJMSConfiguration legacyJMSConfiguration = new LegacyJMSConfiguration(config); | ||
| legacyJMSConfiguration.parseConfiguration(xmlConfigUri.openStream()); | ||
| configuration.setSecurityRoles(config.getSecurityRoles()); | ||
| configuration.setAddressSettings(config.getAddressSettings()); | ||
| configuration.setDivertConfigurations(config.getDivertConfigurations()); | ||
| configuration.setAddressConfigurations(config.getAddressConfigurations()); | ||
| configuration.setQueueConfigs(config.getQueueConfigs()); | ||
| configuration.setBridgeConfigurations(config.getBridgeConfigurations()); | ||
| configuration.setConnectorConfigurations(config.getConnectorConfigurations()); | ||
| configuration.setAcceptorConfigurations(config.getAcceptorConfigurations()); | ||
| configuration.setAMQPConnectionConfigurations(config.getAMQPConnection()); | ||
| configuration.setPurgePageFolders(config.isPurgePageFolders()); | ||
| } | ||
| configuration.parseProperties(propertiesFileUrl); | ||
| config.parseProperties(propertiesFileUrl); | ||
| configuration.setStatus(config.getStatus()); | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to disregard any configuration that was assigned programmatically via an initial configuration object when it sets the configuration from the reload of the possible XML file and then the properties file. It creates an empty configuration vessel which it might fill in from XML and or a properties file(s) set and then hard sets those entries into the existing configuration regardless of the differences between old and new which could lose original data. Its not clear when or why these differing configuration sets take precedence over each other.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that is exactly the intent, the new config is just for the purpose of being reloaded by the reload logic. There is currently no callback for programatic config. Typically broker config is read once at startup. The reload logic is restricted to the set of accessors that support reload, the bits that are copied over after a config is reread. Then the deployReloadableConfigFromConfiguration method does the heavy lifting of applying any changes or not to individual components. So the difference check is all in deployReloadableConfigFromConfiguration |
||
| configuration.setSecurityRoles(config.getSecurityRoles()); | ||
| configuration.setAddressSettings(config.getAddressSettings()); | ||
| configuration.setDivertConfigurations(config.getDivertConfigurations()); | ||
| configuration.setAddressConfigurations(config.getAddressConfigurations()); | ||
| configuration.setQueueConfigs(config.getQueueConfigs()); | ||
| configuration.setBridgeConfigurations(config.getBridgeConfigurations()); | ||
| configuration.setConnectorConfigurations(config.getConnectorConfigurations()); | ||
| configuration.setAcceptorConfigurations(config.getAcceptorConfigurations()); | ||
| configuration.setAMQPConnectionConfigurations(config.getAMQPConnection()); | ||
| configuration.setPurgePageFolders(config.isPurgePageFolders()); | ||
| configuration.setConnectionRouters(config.getConnectionRouters()); // needs reload logic | ||
| configuration.setJaasConfigs(config.getJaasConfigs()); | ||
|
|
||
| updateStatus(ServerStatus.CONFIGURATION_COMPONENT, configuration.getStatus()); | ||
| configurationReloadDeployed.set(false); | ||
| if (isActive()) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.