Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-2076

DLQ flag should be true for dead letter queue even after broker restart

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBoss A-MQ 6.3.x
    • JBoss A-MQ 6.3
    • broker
    • None
    • User Experience

    Description

      DLQ attribute of the dead letter queue is getting changed after broker restart. After restart, broker does not consider dead letter queue as DLQ(DLQ='true') and hence while retryMessages() operation is throws exception as below:

      ERROR: java.lang.RuntimeException: Failed to execute query task. Reason: javax.management.MBeanException: java.lang.Exception: Retry of message is only possible on Dead Letter Queues!

      Replication Steps:

      1. Sends messages in JMS queue where and make sure you set message expiration using

      ~~~
      _producer.setTimeToLive(1000).
      ~~~

      2. Once messages expired, you can see that all the messages are present in DLQ.
      3. When we check the DLQ attribute in the Hawtio console, it is observed as true(DLQ='true') for DLQ. (Check the screenshot BeforeRestartDLQ.png)
      4. Use below command on Karaf console to get output:

      >> activemq:query -QQueue=test_queue.DLQ --invoke retryMessages
      [org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=test_queue.DLQ].retryMessages = 10

      It works as per expectation till here.

      5. Follow the steps-1 and step-2 again.
      6. Restart the A-MQ broker.
      7. Check in Hawtio and DLQ attribute will be false (DLQ='false') for DLQ. (Check screenshot AfterRestartDLQ.png) .

      If we check the output of retry message, we will observe error:

      >> activemq:query -QQueue=test_queue.DLQ --invoke retryMessages
      ERROR: java.lang.RuntimeException: Failed to execute query task. Reason: javax.management.MBeanException: java.lang.Exception: Retry of message is only possible on Dead Letter Queues!

      That is expected behavior. DLQ flag is not stored on disk. It is just set at runtime when used as a dlq. Any queue can become a dlq.

      DLQ attribute should remain true so that even after restart expired messages can be moved back to original destination.

      Attachments

        1. BeforeRestartDLQ.png
          BeforeRestartDLQ.png
          125 kB
        2. AfterRestartDLQ.png
          AfterRestartDLQ.png
          132 kB
        3. activemq.xml
          6 kB

        Issue Links

          Activity

            People

              gtully@redhat.com Gary Tully
              rhn-support-alele Avadhut Lele (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: