2 Replies Latest reply on Aug 9, 2010 3:48 PM by jgkennedy

    Jboss-4.2.1 - Delay redelivery of failed MQ Messages

    chetan_aggarwal_in

      Hi,

       

      I have an MDB listening to WS MQ. I am running JBoss-4.2.1 server. I send a JMS message to a process which responds back with JMS message. Response message is coming back even before my sender's transaction is commited. Due to which receiving MDB fails to handle incoming message.

       

      I do not have any control over client process.

       

      I want to introduce some delay in redelivery messages. For example, first time I get message, it fails, now when it is re-delivered to MDB, i want to introduce some delay of say 2 minutes.

       

      Can I do it? What alternative could be tried?

       

      Please suggest.

       

      Thanks and Regards

      Chetan

        • 1. Re: Jboss-4.2.1 - Delay redelivery of failed MQ Messages
          jgkennedy

          Hi,

          I am using JBOSS 4.3.2 and have exactly the same question.  I want to introduce a longer delay when a JMS message is redelivered.  I've spent some time on this and have found a few old resources and posts.  Like several years ago.

           

          The best info seems to be here: http://docs.jboss.org/jbossmessaging/docs/usermanual-2.0.0.beta1/html/undelivered-messages.html

           

          The snippet at the above link reads:

          <address-setting match="jms.queue.exampleQueue">
                  <redelivery-delay>5000</redelivery-delay>
          </address-setting>

           

          But where exactly would I place this config.  The docs are not clear.

           

          In my situation, when I rollback from my MDB, the messages is redelivered 5 or 6 times in quick succession.  I like the redelivery count, but I need more time between redelivers.  Hasn't been too easy to find this information.

           

          Thanks for any help.

          Jim

          • 2. Re: Jboss-4.2.1 - Delay redelivery of failed MQ Messages
            jgkennedy

            OK, I have this one solved (at least in my situation).  This is straightforward.

             

            Here is a helpful snippet:

             

            <mbean code="org.jboss.jms.server.destination.TopicService"
                  name="jboss.messaging.destination:service=Topic,name=TopicWithOwnRedeliveryDelay"
                  xmbean-dd="xmdesc/Topic-xmbean.xml">
                  <depends optional-attribute-name="ServerPeer">
                              jboss.messaging:service=ServerPeer
                  </depends>
                  <depends>jboss.messaging:service=PostOffice</depends>
                  <attribute name="RedeliveryDelay">5000</attribute>
               </mbean>

            I found this info at: http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.3/doc/messaging/JBoss_Messaging_User_Guide/html-single/index.html

             

            Simply locate where you have defined your queues or topics.  These should be in the {configuration}/deploy/jms directory.  Add the following to your topic or queue:

             

            <attribute name="RedeliveryDelay">5000</attribute>

            This is 5 seconds.  It works.  I did test it.

             

            Jim