From 31b5bdb026c6e5c88496edf42dc8c39ff4c94ed3 Mon Sep 17 00:00:00 2001 From: jbertram Date: Thu, 15 Dec 2016 22:58:22 -0600 Subject: [PATCH] NO-JIRA properly destroy JMS topic --- .../artemis/jms/server/impl/JMSServerManagerImpl.java | 8 +++++++- .../artemis/core/postoffice/impl/PostOfficeImpl.java | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java index 6daf9fb56c..c9c07ef9db 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java @@ -39,6 +39,7 @@ import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration; import org.apache.activemq.artemis.api.core.SimpleString; @@ -814,11 +815,16 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback // We can't remove the remote binding. As this would be the bridge associated with the topic on this case if (binding.getType() != BindingType.REMOTE_QUEUE) { - server.destroyQueue(SimpleString.toSimpleString(queueName), null, !removeConsumers, removeConsumers); + server.destroyQueue(SimpleString.toSimpleString(queueName), null, !removeConsumers, removeConsumers, true); } } if (addressControl.getQueueNames().length == 0) { + try { + server.removeAddressInfo(SimpleString.toSimpleString(name), null); + } catch (ActiveMQAddressDoesNotExistException e) { + // ignore + } removeFromBindings(topics, topicBindings, name); topics.remove(name); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java index 4103a82778..60a6ffaf1b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java @@ -589,12 +589,9 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding throw new ActiveMQNonExistentQueueException(); } - // TODO: see whether we still want to do this or not if (deleteData && addressManager.getBindingsForRoutingAddress(binding.getAddress()) == null) { pagingManager.deletePageStore(binding.getAddress()); - managementService.unregisterAddress(binding.getAddress()); - deleteDuplicateCache(binding.getAddress()); }