mirror of https://github.com/apache/activemq.git
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:
parent
2142045953
commit
8f7dbccf4c
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue