NO-JIRA properly destroy JMS topic
This commit is contained in:
parent
5539c27b4c
commit
31b5bdb026
|
@ -39,6 +39,7 @@ import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
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.ActiveMQException;
|
||||||
import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
|
import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
|
||||||
import org.apache.activemq.artemis.api.core.SimpleString;
|
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
|
// 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) {
|
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) {
|
if (addressControl.getQueueNames().length == 0) {
|
||||||
|
try {
|
||||||
|
server.removeAddressInfo(SimpleString.toSimpleString(name), null);
|
||||||
|
} catch (ActiveMQAddressDoesNotExistException e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
removeFromBindings(topics, topicBindings, name);
|
removeFromBindings(topics, topicBindings, name);
|
||||||
|
|
||||||
topics.remove(name);
|
topics.remove(name);
|
||||||
|
|
|
@ -589,12 +589,9 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
|
||||||
throw new ActiveMQNonExistentQueueException();
|
throw new ActiveMQNonExistentQueueException();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: see whether we still want to do this or not
|
|
||||||
if (deleteData && addressManager.getBindingsForRoutingAddress(binding.getAddress()) == null) {
|
if (deleteData && addressManager.getBindingsForRoutingAddress(binding.getAddress()) == null) {
|
||||||
pagingManager.deletePageStore(binding.getAddress());
|
pagingManager.deletePageStore(binding.getAddress());
|
||||||
|
|
||||||
managementService.unregisterAddress(binding.getAddress());
|
|
||||||
|
|
||||||
deleteDuplicateCache(binding.getAddress());
|
deleteDuplicateCache(binding.getAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue