1 Reply Latest reply on Oct 31, 2011 12:15 AM by jaikiran pai

    How to configure DLQ to be durable?

    daniel_spasojevic Newbie

      Hi,

       

      We are testing our DLQ configuration in AS7 and have found that it does not seem to be durable between application server restarts.

       

      The queue to which messages are sent is configured:

       

      {code:xml}

      <jms-queue name="MyQueue">

           <entry name="queue/MyQueue"/>

      </jms-queue>

      {code}

       

      and the address is configured:

       

      {code:xml}

      <address-setting match="jms.queue.MyQueue">

            <dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>

            <redelivery-delay> 1000</redelivery-delay>

            <max-delivery-attempts>5</max-delivery-attempts>

      </address-setting>

      {code}

       

       

      The DLQ is configured:

       

      {code:xml}

      <jms-queue name="deadLetterQueue">

            <entry name="queue/deadLetterQueue"/>

      </jms-queue>

      {code}

       

      Both of these queues are reported as durable through the JMX Console. When a bad message (one that causes redeliveries to occur) is sent to MyQueue and the application server restarted, redelivery resumes when it is restarted - so it appears to be durable.

       

      After the configured number of redeliveries, the message is sent to the DLQ as expected:

       

      {noformat}

      2011-10-31 10:44:37,441 WARN  [org.hornetq.core.server.impl.QueueImpl] (Thread-15 (group:HornetQ-server-threads31731034-479240824)) Message Reference[4294982256]:RELIABLE:ServerMessage[messageID=4294982256,priority=4,expiration=0, durable=true, address=jms.queue.MyQueue,properties=TypedProperties[{http_content$type=application/json, http_link=<127.0.0.1:53277>; rel=source-host, postedAsHttpMessage=true, http_content$length=8}]] has reached maximum delivery attempts, sending it to Dead Letter Address jms.queue.deadLetterQueue from jms.queue.MyQueue

      {noformat}

       

      When the message is dumped as JSON through the JMX console, the durable property of the message has been retained as expected:

       

      {noformat}

      [

         {

            "_HQ_ORIG_ADDRESS":"jms.queue.MyQueue",

            "_HQ_ORIG_MESSAGE_ID":4294982171,

            "expiration":0,

            "http_content$type":"application/json",

            "http_link":"<127.0.0.1:53086>; rel=source-host",

            "type":4,

            "durable":true,

            "postedAsHttpMessage":true,

            "timestamp":1320017271884,

            "messageID":4294982178,

            "address":"jms.queue.deadLetterQueue",

            "priority":4,

            "http_content$length":"8"

         }

      ]

      {noformat}

       

      However, when the application server is restarted, the message no longer appears on the DLQ. The message count (as reported by the JMX Console) drops to zero.

       

      Besides message and queue durability, what else determines whether a message is persisted between application server restarts? What is the correct way to configure the DLQ so that messages will be retained across restarts? The dead-letter example doesn't seem to do anything differently here.

       

      Thanks,

      -Dan