Avoid local consumer starvation. We were not properly keeping the list sorted.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@639422 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2008-03-20 19:31:36 +00:00
parent 01ab56f7d0
commit f4971bf2dc
1 changed files with 2 additions and 8 deletions

View File

@ -1145,14 +1145,8 @@ public class Queue extends BaseDestination implements Task {
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);
}