2 Replies Latest reply on Jul 22, 2015 6:46 AM by Justin Bertram

    How can i read messages from DLQ?

    ftom2 Newbie

      Hi,

       

      I'm using jboss 7.1.1.final. I need to know whether the DLQ has messages in it, so i thought i would write an MDB that will listen to it:

       

       

      @MessageDriven(messageListenerInterface = MessageListener.class, activationConfig = {
                          @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
                          @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/queue/DLQ"),
                          @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1") })
      public class DLQMDB extends MessageHandler<BaseEvent> {...}
      

       

      I also defined another MDB that listens to a regular queue and thorws error so it'll fail and go to the DLQ.

       

      I have these settings in standalone.xml:

       

       

      <address-setting match="#">
                              <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                              <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                              <redelivery-delay>0</redelivery-delay>
                              <max-size-bytes>10485760</max-size-bytes>
                              <address-full-policy>BLOCK</address-full-policy>
                              <message-counter-history-day-limit>10</message-counter-history-day-limit>
                          </address-setting>
      
      

       

      The DLQ MDB does not get any message, i don't know if it is because i defined the MDB wrong or because there are no messages in the DLQ, am i doing something wrong? Is there a way to see if DLQ has messages without writing an MDB (like logs)?

        • 1. Re: How can i read messages from DLQ?
          Danilo Zeihs Newbie

          Hi!

           

          i'll refresh this topic.

          My problem is nearly the same. In first step i only will identify a message in my DLQ. (JB 7.1.1.Final; )

           

          I think i have one in their:

          [standalone@localhost:9999 jms-queue=testQueue] :read-resource(include-defaults=false,include-runtime=true, proxies=false, recursive-depth=false,recursive=false)
          {
              "outcome" => "success",
              "result" => {
                  "consumer-count" => 1,
                  "dead-letter-address" => "jms.queue.DLQ",
                  "delivering-count" => 1,                     
                  "durable" => undefined,
                  "entries" => [
                      "queue/test",
                      "java:jboss/exported/jms/queue/test"
                  ],
                  "expiry-address" => "jms.queue.ExpiryQueue",
                  "message-count" => 1L,
                  "messages-added" => 18L,
                  "paused" => false,
                  "queue-address" => "jms.queue.testQueue",
                  "scheduled-count" => 0L,
                  "selector" => undefined,
                  "temporary" => false
              }
          }

           

          so, how i can check the message and how i can activate or delete the message in next steps?

          I tried every hours to find everything on web and simply in jboss-cli

           

          dune

          • 2. Re: How can i read messages from DLQ?
            Justin Bertram Master

            Couple of things:

            1. It's typically best to create your own forum thread than hijacking someone else's.
            2. A DLQ is just like any other queue so you can use the CLI to see how many messages it contains and delete those messages if necessary.  You can also use a normal consumer to receive any messages in the queue and deal with them that way.