Implement Client-Side Load Balancing using JMS
If you're using JMS, and you're using JNDI on the server to put your JMS connection factories into JNDI, then you can specify the load balancing policy directly in the hornetq-jms.xml configuration file on the server as follows: org.hornetq.api.core.client.loadbalance.RandomConnectionLoadBalancingPolicy The above example would deploy a JMS connection factory that uses the random connection load balancing policy. If you're using JMS but you're instantiating your connection factory directly on the client side then you can set the load balancing policy using the setter on the HornetQConnectionFactory before using it: ConnectionFactory jmsConnectionFactory = HornetQJMSClient.createConnectionFactory(...); jmsConnectionFactory.setLoadBalancingPolicyClassName("com.acme.MyLoadBalancingPolicy");