activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r636422 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
Date Wed, 12 Mar 2008 17:07:54 GMT
Author: rajdavies
Date: Wed Mar 12 10:07:46 2008
New Revision: 636422

URL: http://svn.apache.org/viewvc?rev=636422&view=rev
Log:
don't throw an exception if removing an invalid subscription -
it could happen from the ConnectionSplitBroker

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java?rev=636422&r1=636421&r2=636422&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
Wed Mar 12 10:07:46 2008
@@ -294,18 +294,18 @@
         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());
-        }
-
-        // 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);
-        }
+        //The sub could be removed elsewhere - see ConnectionSplitBroker
+        if (sub != null) {
 
-        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());
         }



Mime
View raw message