5 Replies Latest reply on Dec 18, 2012 5:50 PM by jbertram

    Implementing custom client-side load balancing policy in hornetq

    sami_gh

      Hi All,

       

      I

      want to implement a load balancing policy in HornetQ that depends on the IP Addresses of the nodes. For example, if a specified node is available connect it to it, otherwise connect to a random node. However, the ConnectionLoadBalancingPolicy interface only gives me the input as a number 

      int select (int max);

      Let's assume that the max is three, I want to know the IP Address of 0,1,2 before selecting the node. Is that possible?

      It is written in that section in HornetQ documentation:

       

      The set of servers over which the factory load balances can be determined in one of two ways:

      • Specifying servers explicitly
      • Using discovery.

       

      So how can I get them using discovery and match them to the max number I get from ConnectionLoadBalancingPolicy ?

      Thanks,

      Sami