From 70406bf21c9b65664ed1f011b3d7cebffda88593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Andr=C3=A9=20Pearce?= Date: Fri, 2 Feb 2018 17:18:21 +0000 Subject: [PATCH] ARTEMIS-1659 - Only reload configuration if the node is Active. --- .../core/server/impl/ActiveMQServerImpl.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java index d7eb2b9e55..dad930005c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java @@ -3103,20 +3103,22 @@ public class ActiveMQServerImpl implements ActiveMQServer { @Override public void reload(URL uri) throws Exception { - Configuration config = new FileConfigurationParser().parseMainConfig(uri.openStream()); - ActiveMQServerLogger.LOGGER.reloadingConfiguration("security"); - securityRepository.swap(config.getSecurityRoles().entrySet()); - ActiveMQServerLogger.LOGGER.reloadingConfiguration("address settings"); - addressSettingsRepository.swap(config.getAddressesSettings().entrySet()); - ActiveMQServerLogger.LOGGER.reloadingConfiguration("diverts"); - for (DivertConfiguration divertConfig : config.getDivertConfigurations()) { - if (postOffice.getBinding(new SimpleString(divertConfig.getName())) == null) { - deployDivert(divertConfig); + if (isActive()) { + Configuration config = new FileConfigurationParser().parseMainConfig(uri.openStream()); + ActiveMQServerLogger.LOGGER.reloadingConfiguration("security"); + securityRepository.swap(config.getSecurityRoles().entrySet()); + ActiveMQServerLogger.LOGGER.reloadingConfiguration("address settings"); + addressSettingsRepository.swap(config.getAddressesSettings().entrySet()); + ActiveMQServerLogger.LOGGER.reloadingConfiguration("diverts"); + for (DivertConfiguration divertConfig : config.getDivertConfigurations()) { + if (postOffice.getBinding(new SimpleString(divertConfig.getName())) == null) { + deployDivert(divertConfig); + } } + ActiveMQServerLogger.LOGGER.reloadingConfiguration("addresses"); + deployAddressesFromConfiguration(config); + undeployAddressesAndQueueNotInConfiguration(config); } - ActiveMQServerLogger.LOGGER.reloadingConfiguration("addresses"); - deployAddressesFromConfiguration(config); - undeployAddressesAndQueueNotInConfiguration(config); } }