8 Replies Latest reply on Jul 27, 2011 3:54 AM by yik_cheung

    mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA

    yik_cheung

      HI!

       

      I have followed the manual to setup live-backup group for two separate server A and B  in a cluster with sharing journal by referening  the example  "mdb-remote-failover-static".   I deployed a mdb on the server C and it is consumer of server A.   I used a  java application to keep  sending the message to ServerA.     If Server A is shutdown,  the mdb did not failover automatically to B.  However,  my java application can keep sending the message with any problem,    I also checked the jmx-console of B  which it has become a live and is receiving my message.      Once,  the Server A is restarted, the mdb just connected back to serverA , then it can receive my message again.  

        • 1. Re: mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA
          clebertsuconic

          You need to define this at your resource adapter:

           

           

          I can't open rar files, if you could edit your post and place a simple zip or jar please.

                <config-property>

                   <description>

                      The transport type. Multiple connectors can be configured by using a comma separated list,

                      i.e. org.hornetq.core.remoting.impl.invm.InVMConnectorFactory,org.hornetq.core.remoting.impl.invm.InVMConnectorFactory.

                   </description>

                   <config-property-name>ConnectorClassName</config-property-name>

                   <config-property-type>java.lang.String</config-property-type>

                   <config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory,org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>

                </config-property>

                <config-property>

                   <description>The transport configuration. These values must be in the form of key=val;key=val;,

                      if multiple connectors are used then each set must be separated by a comma i.e. host=host1;port=5445,host=host2;port=5446.

                      Each set of params maps to the connector classname specified.

                   </description>

                   <config-property-name>ConnectionParameters</config-property-name>

                   <config-property-type>java.lang.String</config-property-type>

                   <config-property-value>host=127.0.0.1;port=5446,host=127.0.0.1;port=5447</config-property-value>

                </config-property>

          • 2. Re: mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA
            yik_cheung

            HI Clebert

             

            I have repacked my files in the zip format.   the ra.xml on Server C had already been modified  before and  you may verify it in the client-conf.zip. 

             

            Here is system setting information:

             

            Server A  192.168.40.87  (jms live node)

            Server B  192.168.40.89  (jms backup node)

            Server C  192.158.40.88  (mdb client )

            • 3. Re: mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA
              clebert.suconic

              Why don't you change your hornetq-configuration.xml to use the IP directly:

               

                <acceptors>

                    <acceptor name="netty">

                       <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                       <param key="host"  value="192.168.40.87"/>

                       <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

                    </acceptor>

               

               

               

              There seems some confusion here...

               

               

              Also: Are you using NFS or a network drive?

               

              That's something we have advised against on the manuals.

              • 4. Re: mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA
                yik_cheung

                HI Clebert

                 

                I just changed to use IP diectly in  all my hornetq-configuration.xml and re-uploaded in my Post.  Please download those zip files again. 

                 

                I am using network drive.   I share the c:\messageing from Server B (jms backup node) and  map y: drive to Server A ( jms live node)..

                • 5. Re: mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA
                  clebert.suconic

                  HI Clebert

                   

                  I just changed to use IP diectly in  all my hornetq-configuration.xml and re-uploaded in my Post.  Please download those zip files again.

                   

                  And what was the result? :-P

                   

                   

                  A network drive is NFS. You shold be using a Shared Disk... which is something totally different.

                  • 6. Re: mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA
                    yik_cheung

                    The result is the same even I have used IP directly in all my hornetq-configuration.... Would it be the configuration problem on the server C (mdb client) because the serverB (jms backup node) can receive my message after ServerA (jms live node) is down?

                    • 7. Re: mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA
                      clebert.suconic

                      Are you sure you're not using the old version of the resource adapter? Can you make sure it was replaced properly.

                       

                      This is something on the MDBs (the client for sure). We have other users making use of this.. so I know it works.

                       

                       

                      How's the example running for your box?

                      • 8. Re: mdb failover problem on hornetq 2.2.5 with Jboss 5.1.0.GA
                        yik_cheung

                        I am sure it is only one version of resourece adapter..  I didn't install any other version of hornetq to jboss 5.1.0 GA except hornetq 2.2.5.  you may check those xml files  inside my client-conf.zip. 

                         

                        I just created a simple mdb which print out a line of dummy message if a topic is received.   This mdb is deployed as EJB 2.1

                         

                         

                         

                        here is Jboss.xml

                         

                        <?xml version="1.0" encoding="UTF-8"?>

                        <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">

                        <jboss>

                           <enterprise-beans>

                              <message-driven>

                                 <ejb-name>testbean</ejb-name>

                                 <destination-jndi-name>topic/testTopic</destination-jndi-name>

                                                   <resource-adapter-name>hornetq-ra.rar</resource-adapter-name>     

                               </message-driven>

                           </enterprise-beans>

                         

                        </jboss>

                         

                         

                         

                        web.xml here is

                         

                        <?xml version='1.0' encoding='UTF-8' ?>

                          ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"

                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                                  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"

                                  version="2.1">

                         

                          <enterprise-beans>    

                           <message-driven>

                              <ejb-name>testbean</ejb-name>

                              <ejb-class>com.afe.sys.g2fo.ejb.test.testbean</ejb-class>

                              <transaction-type>Container</transaction-type>

                                    <message-destination-type>javax.jms.Topic</message-destination-type> 

                           </message-driven>

                          </enterprise-beans>

                        </ejb-jar>