Source:
<code>private void undeployAddressesAndQueueNotInConfiguration(Configuration configuration) throws Exception { Set<String> addressesInConfig = configuration.getAddressConfigurations().stream() .map(CoreAddressConfiguration::getName) .collect(Collectors.toSet()); Set<String> queuesInConfig = configuration.getAddressConfigurations().stream() .map(CoreAddressConfiguration::getQueueConfigurations) .flatMap(List::stream).map(CoreQueueConfiguration::getName) .collect(Collectors.toSet()); for (SimpleString addressName : listAddressNames()) { AddressSettings addressSettings = getAddressSettingsRepository().getMatch(addressName.toString()); if (!addressesInConfig.contains(addressName.toString()) && addressSettings.getConfigDeleteAddresses() == DeletionPolicy.FORCE) { for (Queue queue : listQueues(addressName)) { ActiveMQServerLogger.LOGGER.undeployQueue(queue.getName()); queue.deleteQueue(true); } ActiveMQServerLogger.LOGGER.undeployAddress(addressName); try { removeAddressInfo(addressName, null); } catch (Exception e) { ActiveMQServerLogger.LOGGER.unableToUndeployAddress(addressName, e.getMessage()); } } else if (addressSettings.getConfigDeleteQueues() == DeletionPolicy.FORCE) { for (Queue queue : listConfiguredQueues(addressName)) { if (!queuesInConfig.contains(queue.getName().toString())) { ActiveMQServerLogger.LOGGER.undeployQueue(queue.getName()); try { queue.deleteQueue(true); } catch (Exception e) { ActiveMQServerLogger.LOGGER.unableToUndeployQueue(addressName, e.getMessage()); } <START> } <END> } } } }</code><technical_language>this logic exist in line 3022 also</technical_language>

Target:
private void undeployAddressesAndQueueNotInConfiguration(Configuration configuration) throws Exception { Set<String> addressesInConfig = configuration.getAddressConfigurations().stream() .map(CoreAddressConfiguration::getName) .collect(Collectors.toSet()); Set<String> queuesInConfig = configuration.getAddressConfigurations().stream() .map(CoreAddressConfiguration::getQueueConfigurations) .flatMap(List::stream).map(CoreQueueConfiguration::getName) .collect(Collectors.toSet()); for (SimpleString addressName : listAddressNames()) { AddressSettings addressSettings = getAddressSettingsRepository().getMatch(addressName.toString()); if (!addressesInConfig.contains(addressName.toString()) && addressSettings.getConfigDeleteAddresses() == DeletionPolicy.FORCE) { for (Queue queue : listQueues(addressName)) { ActiveMQServerLogger.LOGGER.undeployQueue(queue.getName()); try { queue.deleteQueue(true); } catch (Exception e) { ActiveMQServerLogger.LOGGER.unableToUndeployQueue(addressName, e.getMessage()); } } ActiveMQServerLogger.LOGGER.undeployAddress(addressName); try { removeAddressInfo(addressName, null); } catch (Exception e) { ActiveMQServerLogger.LOGGER.unableToUndeployAddress(addressName, e.getMessage()); } } else if (addressSettings.getConfigDeleteQueues() == DeletionPolicy.FORCE) { for (Queue queue : listConfiguredQueues(addressName)) { if (!queuesInConfig.contains(queue.getName().toString())) { ActiveMQServerLogger.LOGGER.undeployQueue(queue.getName()); try { queue.deleteQueue(true); } catch (Exception e) { ActiveMQServerLogger.LOGGER.unableToUndeployQueue(addressName, e.getMessage()); } } } } } }