4 Replies Latest reply on Aug 20, 2010 10:19 AM by Joydeep Sarkar

    JMS listener not working

    Joydeep Sarkar Newbie

      Hello,

       

      It appears that in the backup server, after the failover happens, the listeners are not working.

       

      When the failover hppens, the JMX console shows that the messages are going to the testQueue and then moved to ExpiryQueue.

      Now I have two MDBs listening to both testQueue and ExpiryQueue and the messages have stalled in the testQueue. Neither it is being processed nor it is moved to ExpirtQueue.

       

      But the same setup is able to process the messages in the Live server.

       

      Any idea why this is happeing? What is preventing the MDBs to listen to the Queue in the backup server?

       

      Following is the MDB,

      @MessageDriven(
         name = "FailoverTestMDEJB",  mappedName="jms/Queue",
         activationConfig = {
              @ActivationConfigProperty(
                      propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
              @ActivationConfigProperty(
                      //propertyName = "destination", propertyValue = "/queue/oracleXMLQueue"),
                      propertyName = "destination", propertyValue = "/queue/ExpiryQueue"),
              @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
              @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "2")
              } )
      @ResourceAdapter("hornetq-ra.rar")
      public class FailoverTestMDBean implements MessageListener {
          public FailoverTestMDBean() {
          }
          public void onMessage(Message msg) {
              try{
              if (msg instanceof TextMessage){
                      TextMessage tmsg = (TextMessage) msg;
                  System.out.println(""+tmsg.getText());
              }
              }catch(JMSException jmse){
                  jmse.printStackTrace();
              }
          }
      }
      

       

      TIA,

      Joydeep

        • 1. Re: JMS listener not working
          Joydeep Sarkar Newbie

          Alright, there are apparently two aspects,

           

          One is to specify netty factory in the ra.xml as follows,

          <resourceadapter>
                <resourceadapter-class>org.hornetq.ra.HornetQResourceAdapter</resourceadapter-class>
                <config-property>
                   <description>The transport type</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.invm.InVMConnectorFactory</config-property-value> -->
                   <config-property-value>org.hornetq.integration.transports.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;</description>
                   <config-property-name>ConnectionParameters</config-property-name>
                   <config-property-type>java.lang.String</config-property-type>
          <!--         <config-property-value>server-id=0</config-property-value> -->
                   <config-property-value>host=10.1.0.235;port=5445</config-property-value>
                </config-property>
          
          
          

           

           

          Another is the in-vm acceptor in hornetq-configuration.xml

             <acceptors>
                <acceptor name="netty">
                   <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
                   <param key="host"  value="${hornetq.remoting.netty.host:10.1.0.235}"/>
                   <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
                </acceptor>
               <acceptor name="in-vm">
                  <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
                  <param key="server-id" value="0"/>
                </acceptor> 
             </acceptors>
          

           

           

          In both the cases I mentioned above, the MDB is able to listen to the queue successfully.

          BUT, they activate the backup server at the time of startup itself!

          I do not understand if this a bug or a fault of my configuration, but this really has stopped my work since I am not able to proceed with Live-Backup pair.

          Is there any workaround/fix for this?

          Please help.

           

          Looking forward to your response.

           

          Regatds,

          Joydeep

          • 2. Re: JMS listener not working
            Tim Fox Master

            Did you read the dev forum thread on HA improvements that's been mentioned several times?

            • 3. Re: JMS listener not working
              Joydeep Sarkar Newbie

              Well, to be honest I have not.

              Good to hear that improvements are on. So is this issue also being addressed?

              Just wanted to know if any workaround is available to get my work going. Else I will have to simply wait for the improvements to be over.

              I hope you understand.

               

              Regards,
              Joydeep

              • 4. Re: JMS listener not working
                Joydeep Sarkar Newbie

                Hello Tim,

                 

                I have just had a look at the discussion in dev forum, but I do not see any point addressing this issue.

                Please let me know if this a bug for which a JIRA needs to be raised or this is a problem on my part.

                Do you see any workaround for this problem till the enhancements are done?

                What is the targeted date of release of 2.2?

                 

                Regards,

                Joydeep