Issue sending reply messages from mdb in jms cluster
sv_srinivaas Jun 12, 2012 12:26 AMHi,
Version used: Jboss 5.1.0 GA, Hornetq-2.2.5-Final, OS : Linux.
I have a requirement to have cluster of jms nodes and a business node that hosts the MDB to consume and respond to messages through queues. I have an issue sending reply messages from mdb when the jms node configured in jms-ds.xml crashes.
At present we have some limitations in using a shared drive and hence we are unable to use the live-backup model.
Hence I've configured a live-live cluster of jms nodes and in a remote host I've configured the mdb with the in-bound connection in ra.xml having comma separated values for connector class name and connection params as below .
<config-property-name>ConnectorClassName</config-property-name>
<config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory,org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>
<config-property-name>ConnectionParameters</config-property-name>
<config-property-value>host=jms_node1;port=5445,host=jms_node2;port=5445</config-property-value>
With the above config, MDBs are able to consume from both the jms nodes in cluster at any point of time (even if jms_node1 crashes, the mdb can still consume from jms_node2).
Now the issue is, the reply messages from mdb are sent using the below config in jms-ds.xml which is always sending to jms_node1. If jms_node1 crashes then I dont get the reply messages back and the log shows the message "unable to get the connnection for RemoteJmsXA" even though jms_node2 is alive.
<tx-connection-factory>
<jndi-name>RemoteJmsXA</jndi-name> <xa-transaction /> <rar-name>hornetq-ra.rar</rar-name> <connection-definition>org.hornetq.ra.HornetQRAConnectionFactory</connection-definition>
<config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
<config-property name="ConnectorClassName" type="java.lang.String">org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property>
<config-property name="ConnectionParameters" type="java.lang.String">host=jms_node1;port=5445</config-property>
<max-pool-size>20</max-pool-size>
</tx-connection-factory>
Is it possible to send the reply messages from MDB to any of the available nodes in the cluster and not always to jms_node1? If so how do I configure my RemoteJmsXA params?
Also I may have issues using topic for replly messages.
Thanks
Srinivaas