activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michaelandrepearce <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1345: ARTEMIS-1235 Support queue and address ...
Date Thu, 22 Jun 2017 14:00:48 GMT
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1345#discussion_r123517809
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
---
    @@ -2313,6 +2318,53 @@ private void deploySecurityFromConfiguration() {
           }
        }
     
    +   private void undeployAddressesAndQueueNotInConfiguration() throws Exception {
    +      undeployAddressesAndQueueNotInConfiguration(configuration);
    +   }
    +
    +   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);
    +            removeAddressInfo(addressName, null);
    +         } else if (addressSettings.getConfigDeleteQueues() == DeletionPolicy.FORCE)
{
    +            for (Queue queue : listConfiguredQueues(addressName)) {
    +               if (!queuesInConfig.contains(queue.getName().toString())) {
    --- End diff --
    
    method listConfiguredQueues filters to return only configured queues.
    
       private List<Queue> listConfiguredQueues(SimpleString address) throws Exception
{
          return listQueues(address).stream().filter(queue -> !queue.isAutoCreated() &&
!queue.isInternalQueue()).collect(Collectors.toList());
       }


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message