0

I have tried to configure HornetQ server-side load-balancing using clustering. I am using Wildfly 9, and I have done following configuration on standalon-ha.xml file but it is not sharing load between two server.

<cluster-connections>
   <cluster-connection name="tcp-based-cluster-node1-to-node2">
      <address>jms</address>
      <connector-ref>netty</connector-ref>
      <retry-interval>500</retry-interval>
      <use-duplicate-detection>true</use-duplicate-detection>
      <forward-when-no-consumers>true</forward-when-no-consumers>
      <max-hops>1</max-hops>
      <static-connectors>
         <!-- just one connector-ref here -->
         <connector-ref>node2-connector</connector-ref>
      </static-connectors>
   </cluster-connection>
</cluster-connections>

<connectors>
   <netty-connector name="node2-connector" socket-binding="node2-hornetq-binding"/>
</connectors>

<connection-factory name="RemoteConnectionFactory">
   <connectors>
      <connector-ref connector-name="node2-connector"/>
   </connectors>
   <entries>
      <entry name="RemoteConnectionFactory"/>
      <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
   </entries>
   <use-global-pools>false</use-global-pools>
   <scheduled-thread-pool-max-size>200</scheduled-thread-pool-max-size>
   <thread-pool-max-size>-1</thread-pool-max-size>
</connection-factory>

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
       .....
   <outbound-socket-binding name="node2-hornetq-binding">
      <remote-destination host="192.168.102.33" port="9090"/>
   </outbound-socket-binding>
       
</socket-binding-group>

The same configuration was done on the second cluster but message queue is not sharing load between HornetQ servers. Any suggestion what is wrong and which configuration extra need for load sharing? I read many tutorials but not a single suggestion for the same.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • Why did you create `RemoteConnectionFactory` that's pointing to the other node? That's not necessary for clustering. Do you see the cluster bridges forming on the nodes when you start them? How exactly are you testing load balancing? – Justin Bertram Jun 23 '21 at 14:00
  • HI, yes i have read a Jboss clustering article for the same and they people suggest so we try to implement otherwise we already socket binding with server and give static connection in cluster configuration. we are testing load balancing in created queue message come in only one hornetQ it is not sharing with other hornetQ server i am testing this way it is correct? – jignesh Kanjariya Jun 24 '21 at 04:54
  • If you are suggest any configuration article or any other way which can help us to configuration the server side load balancing. Please suggest if you have any idea bout it. – jignesh Kanjariya Jun 24 '21 at 04:57
  • Please elaborate on your testing procedure. Are you connecting a consumer to one cluster node and then sending a message to the _other_ cluster node? If so, what happens? If not, can you test this? – Justin Bertram Jun 25 '21 at 18:49
  • HI, Yes my both hornetQ instance have a consumer and it will be consume from it. i have add clustering logic on XML file of each server. and when i add messages its only add in one server and consume from it. My testing procedure is simple add message in queue of one server and consume from it . No i haven't try if remove one cluster's consumer and it connect to other. – jignesh Kanjariya Jun 28 '21 at 04:26
  • So if you connect a consumer to one cluster node and then send a message to the other cluster node what happens? – Justin Bertram Jun 29 '21 at 02:59

0 Answers0