This closes #931 NO-JIRA properly destroy JMS topic

This commit is contained in:
Andy Taylor 2016-12-16 13:44:48 +00:00
commit 749db25962
2 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -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());
}