From b8d5ca8383c9dd6468e7fdf348d571cdc089fea6 Mon Sep 17 00:00:00 2001 From: Dejan Bosanac Date: Tue, 1 Oct 2013 14:07:22 +0200 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-4758 - improve performance of pull consumers; more improvments; removed obsolete code and added extra check for dropped messages --- .../org/apache/activemq/broker/region/Queue.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java index ee5bb2ef5d..6f4e2faa8e 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -2009,10 +2009,8 @@ public class Queue extends BaseDestination implements Task, UsageListener { MessageReference node = iterator.next(); Subscription target = null; - int interestCount = 0; for (Subscription s : consumers) { if (s instanceof QueueBrowserSubscription) { - interestCount++; continue; } if (!fullConsumers.contains(s)) { @@ -2031,14 +2029,14 @@ public class Queue extends BaseDestination implements Task, UsageListener { LOG.trace("Subscription full {}", s); } } - // make sure it gets dispatched again - if (!node.isDropped()) { - interestCount++; - } + } + + if (target == null && node.isDropped()) { + iterator.remove(); } // return if there are no consumers or all consumers are full - if (target == null && (consumers.size() == 0 || consumers.size() == fullConsumers.size())) { + if (target == null && consumers.size() == fullConsumers.size()) { return list; }