Initial fix for this issue.  Uses a separate collection to track the
creation time of the consumers, might want to test just using a
ConcurrentLinkedQueue since that will stay in creation or naturally
although the remove operations could cost more...removed debug logs.
This commit is contained in:
Timothy Bish 2013-09-20 16:50:20 -04:00
parent 2142045953
commit 8f7dbccf4c
1 changed files with 2 additions and 4 deletions

View File

@ -162,7 +162,6 @@ public class AdvisoryBroker extends BrokerFilter {
ConsumerIdKey key = new ConsumerIdKey(info.getConsumerId());
consumerTracker.put(key.getConsumerId(), key.getCreationTime());
consumers.put(key, info);
LOG.info("Added {} to the map:", key);
fireConsumerAdvisory(context, info.getDestination(), topic, info);
} else {
// We need to replay all the previously collected state objects
@ -325,16 +324,15 @@ public class AdvisoryBroker extends BrokerFilter {
ActiveMQDestination dest = info.getDestination();
if (!AdvisorySupport.isAdvisoryTopic(dest)) {
ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(dest);
Object value = consumerTracker.remove(info.getConsumerId());
if (value != null) {
Long creationTime = (Long) value;
ConsumerIdKey key = new ConsumerIdKey(info.getConsumerId(), creationTime);
if (consumers.remove(key) == null) {
LOG.info("Failed to remove:{} from the consumers map: {}", key, consumers);
LOG.trace("Failed to remove:{} from the consumers map: {}", key, consumers);
}
} else {
LOG.info("Failed to find consumer:{} in creation time tracking map: ", info.getConsumerId());
LOG.trace("Failed to find consumer:{} in creation time tracking map: ", info.getConsumerId());
}
if (!dest.isTemporary() || destinations.containsKey(dest)) {