activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Teira <mte...@tid.es>
Subject Advisory topic leakages (theory)
Date Fri, 06 Jul 2007 11:15:23 GMT
I have observed that the Consumer advisory topics (at least for 
temporary queues) are not disposed, at least in svn 4.1 branch. I think 
that this is caused by the way they are tried to be deleted from the 
AdvisoryBroker removeDestinationInfo method:

            try {
                next.removeDestination(context, 
AdvisorySupport.getConsumerAdvisoryTopic(info.getDestination()), -1);
            } catch (Exception expectedIfDestinationDidNotExistYet) {
            }
            try {
                next.removeDestination(context, 
AdvisorySupport.getProducerAdvisoryTopic(info.getDestination()), -1);
            } catch (Exception expectedIfDestinationDidNotExistYet) {
            }

But that helper method, 
AdvisorySupport.get[Consumer|Producer]AdvisoyTopic is always creating a 
new Topic:

    public static ActiveMQTopic 
getConsumerAdvisoryTopic(ActiveMQDestination destination) {
        if( destination.isQueue() )
            return new 
ActiveMQTopic(QUEUE_CONSUMER_ADVISORY_TOPIC_PREFIX+destination.getPhysicalName());
        else
            return new 
ActiveMQTopic(TOPIC_CONSUMER_ADVISORY_TOPIC_PREFIX+destination.getPhysicalName());
    }

So, what we are feeding to next.removeDestination, where next is 
eventually the RegionBroker chained instance, is a different 
ActiveMQTopic than the original one that we were trying to delete. As 
RegionBroker destinations is a ConcurrentHashMap, and the object we are 
passing to be removed is different from the original one,  is it going 
to remove anything?

The procedure followed in trunk seems to be the same.

Regards.

   



Mime
View raw message