6 Replies Latest reply on Jun 12, 2012 9:38 AM by Yong Hao Gao

    Issue sending reply messages from mdb in jms cluster

    srinivaas venkat Novice

      Hi,

      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

        • 1. Re: Issue sending reply messages from mdb in jms cluster
          Yong Hao Gao Master

          Can you try the same way as in MDB config:

           

          <config-property name="ConnectorClassName" type="java.lang.String">org.hornetq.core.remoting.impl.netty.NettyConnectorFactory,org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property>

          <config-property name="ConnectionParameters" type="java.lang.String">host=jms_node1;port=5445,host=jms_node2;port=5445</config-property>

           

          I'd suggest you try the latest release of HornetQ because there are a lot of bug fixes and enhencements since 2.2.5.Final.

           

          Howard

          1 of 1 people found this helpful
          • 2. Re: Issue sending reply messages from mdb in jms cluster
            srinivaas venkat Novice

            Yong, thanks for your quick response, I tried the latest version 2.2.14 and had issues configuring the xmls in Jboss 5.1.0, Can you pls let me know if i should upgrade to Jboss AS 7.x or so to use the latest versionn of Hornetq which may not be possible now as we have lot of applications running in 5.1.0 or is it possible to use Jboss 5.1.0 itself?

            • 3. Re: Issue sending reply messages from mdb in jms cluster
              Yong Hao Gao Master

              What kind of problem do you have? Any error messages?

               

              Howard

              • 4. Re: Issue sending reply messages from mdb in jms cluster
                srinivaas venkat Novice

                Hi, I get the below exception on server startup when using Hornetq-2.2.14-Final in JBoss-5.1.0 GA. Also i have attached the complete log file.

                 

                Caused by: java.lang.ClassNotFoundException: org.hornetq.jms.server.recovery.AS5

                RecoveryRegistry from BaseClassLoader@1775dde{VFSClassLoaderPolicy@1b3d611{name=

                vfsfile:/D:/Drive%20F/jboss-5.1.0/server/all-with-hornetq/deploy/hornetq.sar/ do

                main=ClassLoaderDomain@913dc1{name=DefaultDomain parentPolicy=BEFORE parent=org.

                jboss.bootstrap.NoAnnotationURLClassLoader@13caecd} roots=[MemoryContextHandler@

                27996002[path= context=vfsmemory://e2r5j9-uhj3l3-h3crnf5h-1-h3cro670-11 real=vfs

                memory://e2r5j9-uhj3l3-h3crnf5h-1-h3cro670-11], FileHandler@28561116[path=hornet

                q.sar context=file:/D:/Drive%20F/jboss-5.1.0/server/all-with-hornetq/deploy/ rea

                l=file:/D:/Drive%20F/jboss-5.1.0/server/all-with-hornetq/deploy/hornetq.sar/]]

                • 5. Re: Issue sending reply messages from mdb in jms cluster
                  srinivaas venkat Novice

                  hi, as per your suggestion tried adding a comma separated value for outbound config and it seems to work but with an exception for some of the messages.

                  Using jboss 5.1.0 and Hornetq-2.2.5-Final.

                   

                  Basically have 2 jms nodes as live-live pairs and one remote node where MDB consumes and send reply messages. Sent 10 messages, 5 went to jms node1 and 5 to jms node2. Mdb consumed from both the nodes and sent reply messages of which 5 to jms1 and 5 to jms 2, Till this point everything was fine.

                   

                  Now i stopped jms node1 and the mdb was only connected to jms node2. Sent 10 messages and this time MDB picked only 6 of them and sent the reply messages. Remaining 4 of them was in the delivering mode in jms node 2 for few minutes and 3 got consumed by MDB and got the reply as well. One message was left uncosumed in the jms node2 indefinitely.

                   

                  Sent another 10 messages and again 6 of them got consumed by MDB and 4 was in delivering mode for few mins and all 4 were consumed after few mins. Meantime got the below exception from MDB node continously.

                   

                  2012-06-12 13:59:05,738 WARN [com.arjuna.ats.jta.logging.loggerI18N] (Thread-6 (group:HornetQ-client-global-threads-980082479)) Can't find resource for bundle java.util.PropertyResourceBundle, key com.arjuna.ats.internal.jta.transaction.arjunacore.timeouterror: [key='com.arjuna.ats.internal.jta.transaction.arjunacore.timeouterror']TransactionImple.enlistResource, XAException.XAER_RMERR, < 131075, 27, 25, 49459748995649555058101101505658521021005550545456584957529748995649555058101101505658521021005550545456584999102 >,

                  2012-06-12 13:59:05,739 WARN [com.arjuna.ats.jta.logging.loggerI18N] (Thread-2 (group:HornetQ-client-global-threads-980082479)) Can't find resource for bundle java.util.PropertyResourceBundle, key com.arjuna.ats.internal.jta.transaction.arjunacore.timeouterror: [key='com.arjuna.ats.internal.jta.transaction.arjunacore.timeouterror']TransactionImple.enlistResource, XAException.XAER_RMERR, < 131075, 27, 25,

                  • 6. Re: Issue sending reply messages from mdb in jms cluster
                    Yong Hao Gao Master

                    Looks like an issue, but it could be fixed in 2.2.14 already. I'd suggest you try the new release. The ClassNotFound seems to indicate that you need to upgrade the AS also (like 5.1.2 or something).

                     

                    Howard

                    1 of 1 people found this helpful