mirror of https://github.com/apache/activemq.git
only rotate consumers if there are consumers to rotate!
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@476093 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c1d82a43c6
commit
e582e2fd40
|
@ -66,7 +66,8 @@ public class RoundRobinDispatchPolicy implements DispatchPolicy {
|
||||||
|
|
||||||
// Rotate the consumer list.
|
// Rotate the consumer list.
|
||||||
try {
|
try {
|
||||||
consumers.add(consumers.remove(0));
|
if (consumers.size() > 1)
|
||||||
|
consumers.add(consumers.remove(0));
|
||||||
} catch (Throwable bestEffort) {
|
} catch (Throwable bestEffort) {
|
||||||
log.error("Caught error rotating consumers",bestEffort);
|
log.error("Caught error rotating consumers",bestEffort);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue