mirror of https://github.com/apache/activemq.git
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:
parent
01ab56f7d0
commit
f4971bf2dc
|
@ -1145,14 +1145,8 @@ public class Queue extends BaseDestination implements Task {
|
||||||
|
|
||||||
private void addToConsumerList(Subscription sub) {
|
private void addToConsumerList(Subscription sub) {
|
||||||
if (useConsumerPriority) {
|
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 {
|
} else {
|
||||||
consumers.add(sub);
|
consumers.add(sub);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue