Author: rajdavies Date: Fri Nov 17 01:48:27 2006 New Revision: 476093 URL: http://svn.apache.org/viewvc?view=rev&rev=476093 Log: only rotate consumers if there are consumers to rotate!
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java?view=diff&rev=476093&r1=476092&r2=476093 ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/RoundRobinDispatchPolicy.java Fri Nov 17 01:48:27 2006 @@ -66,7 +66,8 @@ // Rotate the consumer list. try { - consumers.add(consumers.remove(0)); + if (consumers.size() > 1) + consumers.add(consumers.remove(0)); } catch (Throwable bestEffort) { log.error("Caught error rotating consumers",bestEffort); }