1 Reply Latest reply on Jul 22, 2009 1:57 AM by sjunejo

    DLQ not recieving messages upon Exception

    sjunejo

      Hi All,

      I posted the following issue on Jboss Messaging earlier. Am I in right place this time??? :)

      For now I am running single jBoss 4.2.3GA (which is going to be part of a jBoss cluster). I want to test the JMS FailOver. I am using two Queues called 'Queue' where my browser will put message and MDB will post it to my remote app server let say port '20005' using Resource Adaptor and 'ReplyQueue' from where response will be fetched and give it back to browser.

      Now I have stoped my app server on 20005 and started back on 20003. In the meantime I have deployed one more MDB called MDB-DLQ which will get activated when default DLQ will recieve message when my first MDB should get failed to post message.

      I have check the jBoss console and it shows that my Queue depth is '1' but after failure message is not re-directed to defaul jBoss DLQ (DLQ depth= 0) where my other MDB is waiting???

      My configuartions are...

      destinations-service.xml

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!-- $Id: jbossmq-destinations-service.xml 25907 2004-11-16 04:32:39Z ejort $ -->
      
      <!--
       | This file defines the default Queues and Topics that JBossMQ
       | ships with. The default Queues and Topics are used by the
       | JBoss test suite and by the sample jms programs.
       |
       | You can add other destinations to this file, or you can create other
       | *-service.xml files to contain your application's destinations.
       -->
      
      <server>
       <!-- Destination without a configured SecurityManager or without a
       a SecurityConf will default to role guest with read=true, write=true,
       create=false.
       -->
       <mbean code="org.jboss.mq.server.jmx.Queue"
       name="jboss.mq.destination:service=Queue,name=Queue">
       <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
       </mbean>
       <mbean code="org.jboss.mq.server.jmx.Queue"
       name="jboss.mq.destination:service=Queue,name=ReplyQueue">
       <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
       </mbean>
       </server>
      


      For More Info: there is default DLQ present when I start my jBoss using following command with above custom queues.

      run.bat -b 0.0.0.0 -c all

      Note: -c all --> because I am going to start my other instance when I am going to finish testing this one to make it cluster.

      Any help and suggestions will be appreciated :)

      Regards,

        • 1. Re: DLQ not recieving messages upon Exception
          sjunejo

          This is to support above post having complete setup details for better debugging the problem.

          How to redirect message to default DLQ in jBoss AS 4.2.3GA?.

          DLQ here is the one which is created by jBoss when we start it as run.bat -b 0.0.0.0 -c all [Note: I want it to use cluster setup] along with some other default queues called A,B,C,D,ex... with two of my queues like t24OFSQueue and t24ReplyQueue. When My MDB fail to post message to server it gives an exception where I think by default the message resides in t24OFSQueue should get redirected to DLQ [jndi: queue/DLQ] where one other MDB is waiting and post message to some other instance of my server.

          I have deployed following in my <Jboss_Home>/server/all/deploy directory;

          1) BrowserWeb.war Successfully deployed web application which is putting message on queue and fetching messages back from reply queue.
          2) Jremote-ra.rar   Successfully deployed resource adapter which provides connectivity to the database server on port 20005 using first connection factory in server-ds.xml below. If database server service goes down on port 20005 my primary MDB will give an exception here message should get redirected to jBoss default DLQ and my backup MDB_DLQ should read message from DLQ and will try to use second connection factory which will try to connect on port 20003 where my database server is alive.

          Server-ds.xml (Deployment Descriptor uses above resource adaptor)

          <?xml version="1.0" encoding="utf-8"?>
          
          <!-- ================================================================================ -->
          <!-- -->
          <!-- JBoss Server Configuration -->
          <!-- -->
          <!-- jRemote resource adapter deployment for JBoss, configured for local connection -->
          <!-- -->
          <!-- ================================================================================ -->
          
          <connection-factories>
          
           <tx-connection-factory>
           <jndi-name>jca/t24ConnectionFactory</jndi-name>
          
           <rar-name>jremote-ra.rar</rar-name>
           <connection-definition>com.jbase.jremote.JConnectionFactory</connection-definition>
          
           <config-property name="host" type="java.lang.String">10.44.5.138</config-property> -->
           <config-property name="port" type="java.lang.Integer">20005</config-property>
          
           <config-property name="allowInput" type="java.lang.Boolean">true</config-property>
          
           <config-property name="compression" type="java.lang.Boolean">true</config-property>
           <config-property name="compressionThreshold" type="java.lang.Integer">2048</config-property>
          
           <!--pooling parameters-->
           <min-pool-size>1</min-pool-size>
           <max-pool-size>10</max-pool-size>
           <prefill>true</prefill>
          
           </tx-connection-factory>
          
           <tx-connection-factory>
           <jndi-name>jca/t24ConnectionFactory_DLQ</jndi-name>
          
           <rar-name>jremote-ra.rar</rar-name>
           <connection-definition>com.jbase.jremote.JConnectionFactory</connection-definition>
          
           <config-property name="host" type="java.lang.String">10.44.5.138</config-property> -->
           <config-property name="port" type="java.lang.Integer">20003</config-property>
          
           <config-property name="allowInput" type="java.lang.Boolean">true</config-property>
          
           <config-property name="compression" type="java.lang.Boolean">true</config-property>
           <config-property name="compressionThreshold" type="java.lang.Integer">2048</config-property>
          
           <!--pooling parameters
           <min-pool-size>1</min-pool-size>-->
          
           <max-pool-size>10</max-pool-size>
          
           <!--<prefill>true</prefill>-->
          
           </tx-connection-factory>
          
          </connection-factories>


          Destination-service.xml (For JMS)

          <?xml version="1.0" encoding="UTF-8"?>
          
          <!-- $Id: jbossmq-destinations-service.xml 25907 2004-11-16 04:32:39Z ejort $ -->
          
          <!--
           | This file defines the default Queues and Topics that JBossMQ
           | ships with. The default Queues and Topics are used by the
           | JBoss test suite and by the sample jms programs.
           |
           | You can add other destinations to this file, or you can create other
           | *-service.xml files to contain your application's destinations.
           -->
          
          <server>
           <!-- Destination without a configured SecurityManager or without a
           a SecurityConf will default to role guest with read=true, write=true,
           create=false.
           -->
           <mbean code="org.jboss.mq.server.jmx.Queue"
           name="jboss.mq.destination:service=Queue,name=t24OFSQueue">
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
           </mbean>
           <mbean code="org.jboss.mq.server.jmx.Queue"
           name="jboss.mq.destination:service=Queue,name=t24OFSReplyQueue">
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
           </mbean>
          
          </server>
          


          MDB is a jar file contains following xml in META-INF

          Ejb-jar.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <ejb-jar id="EJBJar_OfsMessageMDB" version="2.1" 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">
           <display-name>OFSMessage</display-name>
           <enterprise-beans>
           <message-driven id="MessageDriven_OfsMessageMDB"> <!—- Simple message driven bean-->
           <display-name>OFSMessage Bean</display-name>
           <ejb-name>OFSMessageMDB</ejb-name>
           <ejb-class>com.temenos.ofsmessage.mdb.OFSMessageMDB</ejb-class>
           <messaging-type>javax.jms.MessageListener</messaging-type>
           <transaction-type>Bean</transaction-type>
           <message-destination-type>javax.jms.Queue</message-destination-type>
           <activation-config>
           <activation-config-property>
           <activation-config-property-name>acknowledgeMode</activation-config-property-name>
           <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
           </activation-config-property>
           </activation-config>
           <resource-ref id="ResourceRef_jmsQueueConnectionFactory">
           <description>T24 Queue Connection Factory</description>
           <res-ref-name>jms/jmsConnectionFactory</res-ref-name>
           <res-type>javax.jms.QueueConnectionFactory</res-type>
           <res-auth>Container</res-auth>
           </resource-ref>
           <resource-ref id="ResourceRef_t24ConnectionFactory">
           <description>T24 JCA Connection Factory</description>
           <res-ref-name>jca/t24ConnectionFactory</res-ref-name>
           <res-type>com.jbase.jremote.JConnectionFactory</res-type>
           <res-auth>Container</res-auth>
           </resource-ref>
           <resource-ref id="ResourceRef_t24OFSReplyQueue">
           <description>OFS reply queue</description>
           <res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
           <res-type>javax.jms.Queue</res-type>
           <res-auth>Container</res-auth>
           </resource-ref>
           </message-driven>
          
           <message-driven id="MessageDriven_OfsMessageMDB_DLQ">
           <display-name>OFSMessage Bean DLQ</display-name> <!—-DLQ message driven bean-->
           <ejb-name>OFSMessageMDB_DLQ</ejb-name>
           <ejb-class>com.temenos.ofsmessage.mdb.OFSMessageMDB</ejb-class>
           <messaging-type>javax.jms.MessageListener</messaging-type>
           <transaction-type>Bean</transaction-type>
           <message-destination-type>javax.jms.Queue</message-destination-type>
           <activation-config>
           <activation-config-property>
           <activation-config-property-name>acknowledgeMode</activation-config-property-name>
           <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
           </activation-config-property>
           </activation-config>
           <resource-ref id="ResourceRef_jmsQueueConnectionFactory_DLQ">
           <description>T24 Queue Connection Factory</description>
           <res-ref-name>jms/jmsConnectionFactory</res-ref-name>
           <res-type>javax.jms.QueueConnectionFactory</res-type>
           <res-auth>Container</res-auth>
           </resource-ref>
           <resource-ref id="ResourceRef_t24ConnectionFactory_DLQ">
           <description>T24 JCA Connection Factory</description>
           <res-ref-name>jca/t24ConnectionFactory</res-ref-name>
           <res-type>com.jbase.jremote.JConnectionFactory</res-type>
           <res-auth>Container</res-auth>
           </resource-ref>
           <resource-ref id="ResourceRef_t24OFSReplyQueue_DLQ">
           <description>OFS reply queue</description>
           <res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
           <res-type>javax.jms.Queue</res-type>
           <res-auth>Container</res-auth>
           </resource-ref>
           </message-driven>
           </enterprise-beans>
          </ejb-jar>
          


          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>OFSMessageMDB</ejb-name>
           <destination-jndi-name>queue/t24OFSQueue</destination-jndi-name>
           <resource-ref>
           <res-ref-name>jms/jmsConnectionFactory</res-ref-name>
           <jndi-name>java:/ConnectionFactory</jndi-name>
           </resource-ref>
           <resource-ref>
           <res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
          <!-- <res-type>javax.jms.Queue</res-type>
          -->
           <jndi-name>queue/t24OFSReplyQueue</jndi-name>
           </resource-ref>
           <resource-ref>
           <res-ref-name>jca/t24ConnectionFactory</res-ref-name>
           <jndi-name>java:jca/t24ConnectionFactory</jndi-name>
          <!-- <res-type>com.jbase.jremote.JConnectionFactory</res-type>
          -->
           </resource-ref>
           </message-driven>
          
           <message-driven>
           <ejb-name>OFSMessageMDB_DLQ</ejb-name>
           <destination-jndi-name>queue/DLQ</destination-jndi-name> <!—Default DL Queue Refrenece -->
           <resource-ref>
           <res-ref-name>jms/jmsConnectionFactory</res-ref-name>
           <jndi-name>java:/ConnectionFactory</jndi-name>
           </resource-ref>
           <resource-ref>
           <res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
           <!--<res-type>javax.jms.Queue</res-type>-->
           <jndi-name>queue/t24OFSReplyQueue</jndi-name>
           </resource-ref>
           <resource-ref>
           <res-ref-name>jca/t24ConnectionFactory</res-ref-name>
           <jndi-name>java:jca/t24ConnectionFactory_DLQ</jndi-name>
           <!--<res-type>com.jbase.jremote.JConnectionFactory</res-type>-->
           </resource-ref>
           </message-driven>
           </enterprise-beans>
          </jboss>
          


          Is Something missing in here because I can not see any message redirection to DLQ. If you require any other information about my setup please let me know.

          Regards,