fail-over using HornetQJMSClient
jbride Apr 12, 2013 8:14 PMHi.
I"m making use of the HornetQJMSClient in a standalone JVM similar to how it's being used in SymmetricClusterExample.java .
My HA configured brokers are configured in domain mode in EAP6.0.1 (all clients and brokers used hornetq libraries from EAP6.0.1 --> hornetq--2.2.23.Final-redhat-1 )
When using the HornetQJMSClient, fail-over of the client connection bombs when the primary broker is shutdown and its backup comes on line:
javax.jms.IllegalStateException: Consumer is closed [java] at org.hornetq.core.client.impl.ClientConsumerImpl.checkClosed(ClientConsumerImpl.java:961) [java] at org.hornetq.core.client.impl.ClientConsumerImpl.receive(ClientConsumerImpl.java:186) [java] at org.hornetq.core.client.impl.ClientConsumerImpl.receive(ClientConsumerImpl.java:391) [java] at org.hornetq.jms.client.HornetQMessageConsumer.getMessage(HornetQMessageConsumer.java:225) [java] at org.hornetq.jms.client.HornetQMessageConsumer.receive(HornetQMessageConsumer.java:134)
As a comparison, with the exact same broker environment, when switching to a client that uses jndi to lookup the ConnectionFactory ..... fail-over behavior of the client occurs flawlessly as per Hornetq documentation.
Any hints as to where i may have misconfigured something ???
I've bumped up client-side logging and conducted tests for both a UDP discovery based client and a JNDI based client.
The results are attached.
What seems interesting is the following message on line 304 of hornetq.udp log :
calling cleanup on ClientSessionImpl [name=b3134f40-a3c8-11e2-83ba-3183c7406c01, username=null, closed=false, factory = ClientSessionFactoryImpl [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5645&host=192-168-122-1], discoveryGroupConfiguration=DiscoveryGroupConfiguration [discoveryInitialWaitTimeout=10000, groupAddress=231.7.7.7, groupPort=9876, localBindAddress=null, name=b0e6842d-a3c8-11e2-83ba-3183c7406c01, refreshTimeout=10000]], connectorConfig=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5645&host=192-168-122-1, backupConfig=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5545&host=192-168-122-1], metaData=(jms-session=,)]@98dbc96
...and then the previous exception is thrown. In comparison, on line 304 of hornetq.jndi, the following message is logged :
Trying reconnection attempt 0/-1
..... and then the connection created from JNDI fails-over to the backup broker just fine.
thanks! jeff
-
hornetq.udp.zip 1.6 KB
-
hornetq.jndi.zip 2.2 KB