Jboss 7.1 hornetq cluster using static connectors, client node is failing to connect in some specific scenarios
meabhi007 May 25, 2016 2:12 PMHi,
I am trying to create the 2 nodes HornetQ cluster using <static-connectors> (its a active-active cluster)
Cluster is working fine, in following scenarios:
- Both hornetQ nodes are up. connecting client.
- shutting down one HornetQ server. ***Outcome: client fails over to other HornetQ server.
- restart 1st HornetQ, shutdown other hornetQ ***Outcome: client fails over to other HornetQ server.
- restart 2nd HornetQ, shutdown 1st hornetQ ***Outcome: client fails over to other HornetQ server.
Conclusion: IF client was started when both hornetQ servers were up and running, failover working fine.
Cluster is failing in following scenario:
- One hornetQ server is up, connect client.
- start other hornetQ server, shutdown first hornetQ server. *** Outcome: client is logging exception that HornetQ server is down, trying to connect the same.
Conclusion: If Client was started when Only one HornetQ server was up. now even if other node of cluster is started later, client is not able to failover to active node.
On the Messaging server node, configuration is mentioned below, Where "netty-connector-cluster-node" is FQDN for other Hornetq server.
<subsystem xmlns="urn:jboss:domain:messaging:1.2">
...
<connectors>
<netty-connector name="netty-connector-cluster-node" socket-binding="jms-cluster-node"/>
</connectors>
<cluster-connections>
<cluster-connection name="my-cluster">
<address>jms</address>
<connector-ref>netty</connector-ref>
<static-connectors>
<connector-ref>netty-connector-cluster-node</connector-ref>
</static-connectors>
</cluster-connection>
...
</subsystem>
On the client machine, configuration is as mentioned below, where netty-connector-cluster-node-1, netty-connector-cluster-node-2 are FQDN for both HornetQ servers.
<subsystem xmlns="urn:jboss:domain:messaging:1.2">
...
<connectors>
<netty-connector name="netty-connector-cluster-node-1" socket-binding="jms-cluster-node-1"/>
<netty-connector name="netty-connector-cluster-node-2" socket-binding="jms-cluster-node-2"/>
</connectors>
...
<jms-connection-factories>
...
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<consumer-window-size>0</consumer-window-size>
<connectors>
<connector-ref connector-name="netty-connector-cluster-node-1"/>
<connector-ref connector-name="netty-connector-cluster-node-2"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
<connection-ttl>600000</connection-ttl>
<client-failure-check-period>120000</client-failure-check-period>
</pooled-connection-factory>
</jms-connection-factories>
...
</subsystem>