mirror of https://github.com/apache/activemq.git
don't throw an exception if removing an invalid subscription -
it could happen from the ConnectionSplitBroker git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@636422 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
58cf400836
commit
22565e4176
|
@ -294,18 +294,18 @@ public abstract class AbstractRegion implements Region {
|
|||
LOG.debug("Removing consumer: " + info.getConsumerId());
|
||||
|
||||
Subscription sub = subscriptions.remove(info.getConsumerId());
|
||||
if (sub == null) {
|
||||
throw new IllegalArgumentException("The subscription does not exist: " + info.getConsumerId());
|
||||
//The sub could be removed elsewhere - see ConnectionSplitBroker
|
||||
if (sub != null) {
|
||||
|
||||
// remove the subscription from all the matching queues.
|
||||
for (Iterator iter = destinationMap.get(info.getDestination())
|
||||
.iterator(); iter.hasNext();) {
|
||||
Destination dest = (Destination) iter.next();
|
||||
dest.removeSubscription(context, sub);
|
||||
}
|
||||
|
||||
destroySubscription(sub);
|
||||
}
|
||||
|
||||
// remove the subscription from all the matching queues.
|
||||
for (Iterator iter = destinationMap.get(info.getDestination()).iterator(); iter.hasNext();) {
|
||||
Destination dest = (Destination)iter.next();
|
||||
dest.removeSubscription(context, sub);
|
||||
}
|
||||
|
||||
destroySubscription(sub);
|
||||
|
||||
synchronized (consumerChangeMutexMap) {
|
||||
consumerChangeMutexMap.remove(info.getConsumerId());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue