activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r473223 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Date Fri, 10 Nov 2006 07:28:28 GMT
Author: aco
Date: Thu Nov  9 23:28:27 2006
New Revision: 473223

URL: http://svn.apache.org/viewvc?view=rev&rev=473223
Log:
Added optimization to determine the highest priority consumer during addition of subscription.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?view=diff&rev=473223&r1=473222&r2=473223
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Thu Nov  9 23:28:27 2006
@@ -82,7 +82,7 @@
     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 @@
                     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) {



Mime
View raw message