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

    HornetQ Equivalent

    mmuthu

      All,

       

      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();

      mqQcf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);

      mqQcf.setUseConnectionPooling(false);

       

      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();
      qcf = jmsInitInfo.JMS_QUEUE_DEFAULT_CONNECTION_FACTORY;

      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