Added optimization to determine the highest priority consumer during addition of subscription.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@473223 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2006-11-10 07:28:27 +00:00
parent 8951023556
commit a8f4f6978c
1 changed files with 7 additions and 2 deletions

View File

@ -82,7 +82,7 @@ public class Queue implements Destination {
protected long garbageSizeBeforeCollection = 1000;
private DispatchPolicy dispatchPolicy = new RoundRobinDispatchPolicy();
protected final MessageStore store;
protected int highestSubscriptionPriority;
protected int highestSubscriptionPriority = Integer.MIN_VALUE;
private DeadLetterStrategy deadLetterStrategy = new SharedDeadLetterStrategy();
private MessageGroupMapFactory messageGroupMapFactory = new MessageGroupHashBucketFactory();
@ -166,9 +166,14 @@ public class Queue implements Destination {
consumers.add(0, sub);
} else {
consumers.add(sub);
}
if (sub.getConsumerInfo().getPriority() > highestSubscriptionPriority) {
highestSubscriptionPriority = sub.getConsumerInfo().getPriority();
}
}
highestSubscriptionPriority = calcHighestSubscriptionPriority();
//highestSubscriptionPriority = calcHighestSubscriptionPriority();
msgContext.setDestination(destination);
synchronized (messages) {