3 Replies Latest reply on Mar 27, 2013 11:55 AM by ataylor

    Cluster Load Balancing Policy - Server Side

    johnnysoccer

      Is the only option available on the server side for load balancing a cluster Round-Robin style message distribution?

       

      We would like to be able to have our cluster just pick one of the available queues on an available node (assuming no active consumers are connected) and direct all messages to that queue instead of doing round robin distribution.

      I know the client allows you to implement ConnectionLoadBalancingPolicy and I was wondering if there is an option to do this on the server side as well?

       

      thanks,

      John

        • 1. Re: Cluster Load Balancing Policy - Server Side
          jbertram

          The closest thing you can get to what you want is setting foward-when-no-consumers to false.  See http://docs.jboss.org/hornetq/2.3.0.CR1/docs/user-manual/html/clusters.html#clusters.cluster-connections.

          • 2. Re: Cluster Load Balancing Policy - Server Side
            johnnysoccer

            We already use forward-when-no-consumers to false.

             

            In our particular scenario, we are using a cluster, and each client (durable subscriptions) maintains a primary and secondary connection to the cluster, only using one of those connections at a time.  The situation we have, is that when that client is disconnected for whatever reason, messages published for that client then round-robin between the to durable subscriptions on the cluster.  When the client reconnects, we can wait for the redistribution-delay to kick in to move all messages to the active connection, but then they are out-of-order from the way they were originally published, which is a problem.

             

            We are essentially doing a poor mans HA, but without having to commit resources to a passive backup server.  What would be nice is to have the option of plugging in a load balancing policy on the server side, and in our case, when there are no active connections, just use a policy that picks one of the queue's and sends all the messages there, that way we can maintain ordering based on how the data was published.

            • 3. Re: Cluster Load Balancing Policy - Server Side
              ataylor

              You could use message grouping, this will pin messages to a particular node and then pin them on that node to a specific consumer. You have to make sure that redistribution is disabled when using this feature.