2 Replies Latest reply on May 28, 2012 5:07 AM by Muthukumaran Manickavasagam

    HornetQ Equivalent

    Muthukumaran Manickavasagam Newbie



      We have following code in our system (legacy) which takes care of load balancing when we run the MQ behind a hardware load balancer. 



      MQQueueConnectionFactory mqQcf = new MQQueueConnectionFactory();




      The above code causes the load balancer to send each message send/receive to work in round robin fashion.


      Is there a similar functionality i can get it with HornetQ. I'm running HornetQ standalone server behind my load balancer. My current version is HQ_2_2_8_EAP_CR2 and i have following already. Please note that i'm not using JNDI,


      Map<String, Object> connectionParams = new HashMap<String, Object>();
      String host = null, port = null;
      host = jmsInitInfo.getMessagingHost();
      port = jmsInitInfo.getMessagingPort();

      connectionParams.put(TransportConstants.HOST_PROP_NAME, host);
      connectionParams.put(TransportConstants.PORT_PROP_NAME, port);
      connectionParams.put(TransportConstants.SSL_ENABLED_PROP_NAME, "true");

      TransportConfiguration tc = new TransportConfiguration(NettyConnectorFactory.class.getName(), connectionParams);

      ServerLocator sl = new ServerLocatorImpl(false, tc);
      queueConnectionFactory = (QueueConnectionFactory)new HornetQJMSConnectionFactory(sl);


      It happens that after my connection to a queue via loadbalancer it looks like the messages are going to the same server. How to avoid this stickyness...?


      -- Muthu