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

This commit is contained in:
Dejan Bosanac 2013-10-01 14:07:22 +02:00
parent 8550f93031
commit b8d5ca8383
1 changed files with 5 additions and 7 deletions

View File

@ -2009,10 +2009,8 @@ public class Queue extends BaseDestination implements Task, UsageListener {
MessageReference node = iterator.next(); MessageReference node = iterator.next();
Subscription target = null; Subscription target = null;
int interestCount = 0;
for (Subscription s : consumers) { for (Subscription s : consumers) {
if (s instanceof QueueBrowserSubscription) { if (s instanceof QueueBrowserSubscription) {
interestCount++;
continue; continue;
} }
if (!fullConsumers.contains(s)) { if (!fullConsumers.contains(s)) {
@ -2031,14 +2029,14 @@ public class Queue extends BaseDestination implements Task, UsageListener {
LOG.trace("Subscription full {}", s); 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 // 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; return list;
} }