Laurent Bigonville created ARTEMIS-1733:

             Summary: RoundRobinConnectionLoadBalancingPolicy always connect to 
the 1st broker at startup
                 Key: ARTEMIS-1733
             Project: ActiveMQ Artemis
          Issue Type: Bug
            Reporter: Laurent Bigonville


When using the client-side-load-balancing from apache activemq artemis examples 
on my own setup (2 RH amq) I see that the first connection is always going to 
the same broker. The documentation says that 
RoundRobinConnectionLoadBalancingPolicy should 1st pick up a random broker and 
then do round-robin, but that 1st step doesn't seems to work.

I've the the following string in the and starting the example 
with mvn -PnoServer verify:




Adding some printnl() in the select() function of 
RoundRobinConnectionLoadBalancingPolicy, I see that pos = 
RandomUtil.randomInterval(0, max); is being called with max value of 1 the 1st 
time(should be 2 as there are two servers). The subsequent calls to that 
functions show that max value is then set to 2 as expected.

This explains why I always get my applications to connect to the same broker.

This message was sent by Atlassian JIRA

Reply via email to