Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
5.5.1
-
5.5.1, Mac OS X 10.7.2
Description
When removing a durable topic subscription, the subscriptions map is left with the durable subscription on the map. This means that if you were to remove the topic and then recreate the topic, you end up with a continually increasing consumerCount on the Topic. Replication on the Web Admin console is:
- Create inactive durable subscriber
- delete the associated topic
- delete inactive durable subscriber
- Create inactive durable subscriber
The topic will now think/show it has 2 subscribers on the destinationStatistics associated with the topic.
This seems to boil down to an accidental use of identity comparison on the subscriptions map in the method {{public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception }}:
196 if (subscriptions.get(sub.getConsumerInfo()) != null) { 197 super.removeConsumer(context, sub.getConsumerInfo()); 198 } else { 199 // try destroying inactive subscriptions 200 destroySubscription(sub); 201 }
which should be (i think):
196 if (subscriptions.get(sub.getConsumerInfo().getConsumerId()) != null) { 197 super.removeConsumer(context, sub.getConsumerInfo()); 198 } else { 199 // try destroying inactive subscriptions 200 destroySubscription(sub); 201 }
Subscriptions are added to the map using the getConsumerId(), not the identity of the ConsumerInfo object; elsewhere in the class; hence the suggestion for using getConsumerId()
Hope that makes sense.
cheers
/dom