activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r639422 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Date Thu, 20 Mar 2008 19:31:37 GMT
Author: chirino
Date: Thu Mar 20 12:31:36 2008
New Revision: 639422

URL: http://svn.apache.org/viewvc?rev=639422&view=rev
Log:
Avoid local consumer starvation.  We were not properly keeping the list sorted.  


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

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=639422&r1=639421&r2=639422&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Thu Mar 20 12:31:36 2008
@@ -1145,14 +1145,8 @@
     
     private void addToConsumerList(Subscription sub) {
         if (useConsumerPriority) {
-            int index = Collections
-                    .binarySearch(consumers, sub, orderedCompare);
-            // insert into the ordered list
-            if (index < 0) {
-                consumers.add(-index - 1, sub);
-            } else {
-                consumers.add(sub);
-            }
+            consumers.add(sub);
+            Collections.sort(consumers, orderedCompare);
         } else {
             consumers.add(sub);
         }



Mime
View raw message