[jboss-dev] Help: DLQ Message Redirection Problem

Sheeraz Junejo SJunejo at temenos.com
Wed Jul 22 02:06:44 EDT 2009


Howard,

 

I couldn't find anything about jBoss MQ DLQ procedure anywhere. Yesterday I was searching and found out about jBoss messaging and I think should abandon the MQ stuff and move forward with jBoss messaging I tried to setup yesterday but fail to start my server successfully. If you have complete guide for how to install messaging on jBoss 4.2.3 using MySQL as a shared database as I have to setup a Cluster please let me know.

 

Regards,

 

--

Sheeraz

 

From: jboss-development-bounces at lists.jboss.org [mailto:jboss-development-bounces at lists.jboss.org] On Behalf Of Howard Gao
Sent: 21 July 2009 10:18
To: JBoss.org development list
Subject: Re: [jboss-dev] Help: DLQ Message Redirection Problem

 

Hi,

I'm not familiar with JBoss MQ but in JBoss Messaging 1.4 only when a message has failed to be delivered for certain times (default 10) can it go to DLQ if present. I think JBoss MQ should have similar meaning. Can you check with the jboss mq doc to make sure you are using it right?

Howard


Sheeraz Junejo wrote: 

Hi,

 

I am hoping to get some answer from this list(finger crossed). My question is; How to redirect message to default DLQ?.

 

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 queues called A,B,C,D... with two of my queues like RequestQueue and ResponseQueue. When My MDB fail to post message to server it gives an exception where I think by default the message resides in RequestQueue 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;

 

BrowserWeb.war                            à Successfully deployed web application which is putting message on queue and fetching messages back from reply queue.

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'. 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. Your response and help will be appreciated.

 

Regards,

 

--

Sheeraz Junejo

 

Disclaimer:
If you have received this e-mail in error please notify the sender. 
Please note that any views or opinions presented in this e-mail are solely 
those of the author and do not necessarily represent those of TEMENOS. 
We recommend that you check this e-mail and any attachments against viruses. 
TEMENOS accepts no liability for any damage caused by any malicious code 
or virus transmitted by this e-mail.
 
 


________________________________



 
_______________________________________________
jboss-development mailing list
jboss-development at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-development

 


Disclaimer:
If you have received this e-mail in error please notify the sender. 
Please note that any views or opinions presented in this e-mail are solely 
those of the author and do not necessarily represent those of TEMENOS. 
We recommend that you check this e-mail and any attachments against viruses. 
TEMENOS accepts no liability for any damage caused by any malicious code 
or virus transmitted by this e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-development/attachments/20090722/324e6f04/attachment.html 


More information about the jboss-development mailing list