mirror of https://github.com/apache/activemq.git
doDispatch():
only apply message to least loaded if target subscription not already found git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@629007 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
40950bc4b8
commit
8768a04e63
|
@ -978,7 +978,6 @@ public class Queue extends BaseDestination implements Task {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doDispatch(List<MessageReference> list) throws Exception {
|
private void doDispatch(List<MessageReference> list) throws Exception {
|
||||||
|
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
synchronized (consumers) {
|
synchronized (consumers) {
|
||||||
for (MessageReference node : list) {
|
for (MessageReference node : list) {
|
||||||
|
@ -998,8 +997,8 @@ public class Queue extends BaseDestination implements Task {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (targets != null) {
|
if (target == null && targets != null) {
|
||||||
// pick the least loaded to add the messag too
|
// pick the least loaded to add the message too
|
||||||
|
|
||||||
for (Subscription s : targets) {
|
for (Subscription s : targets) {
|
||||||
if (target == null
|
if (target == null
|
||||||
|
@ -1012,7 +1011,8 @@ public class Queue extends BaseDestination implements Task {
|
||||||
target.add(node);
|
target.add(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (target != null && !dispatchSelector.isExclusiveConsumer(target)) {
|
if (target != null
|
||||||
|
&& !dispatchSelector.isExclusiveConsumer(target)) {
|
||||||
consumers.remove(target);
|
consumers.remove(target);
|
||||||
consumers.add(target);
|
consumers.add(target);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue