4 Replies Latest reply on Nov 3, 2009 7:29 AM by Tom Eicher

    DLQ messages stored forever - how to access?

    Tom Eicher Newbie

      Hi all,

      I'm wondering how this DLQ thing is supposed to work .-)
      Basically, we have our own error services and queues, but somehow
      a handful of messages end up in the DLQ over time.

      I'd be very interested, what these messages are and what they contain,
      but when I go to the JMX console and call listMessages() on
      Queue DeadMessageQueue or other methods there, it's always count=0,
      empty list, ...

      But when I go to the database, table MESSAGES, I see there's now 150
      messages with classification=DLQ, delivered=TRUE in the table.

      -> How can I find out what these messages are ? They're
      base64-something-encoded (double-base64-something-encoded in
      ESB 4.5 if I read the JIRA correctly)...
      Any way to access the content ?

      -> How are they supposed to disappear ? The database just grows and
      grows...

      Cheers, Tom

        • 1. Re: DLQ messages stored forever - how to access?
          Hans Wolffenbuttel Expert

          Hi,

          Accessing content from a DLQ can be done by using the method getAllMessages() from class org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl by using the classification DLQ. The class deserializes and decodes the message.

          Regards.

          Hans

          • 2. Re: DLQ messages stored forever - how to access?
            Tom Eicher Newbie


            Thanks! I'll try to build a basic client to display the contents.

            But what is the grand master plan here for people using an ESB
            in production ? Shall we have a cron job deleting those message
            once a week ? Or are they supposed to be picked up by some service ?
            Currently, they are only expanding the footprint of our DB...

            Cheers, Tom.

            • 3. Re: DLQ messages stored forever - how to access?
              Hans Wolffenbuttel Expert

              Hi,

              I face the same problem and haven't got an answer yet. But I might try to build something like a jBPM process which can show me the messages before I delete them. This means its possible for the users to discard the messages themselves.

              Anyone else have any thoughts on this?

              Regards,

              Hans

              • 4. Re: DLQ messages stored forever - how to access?
                Tom Eicher Newbie

                FYAI: to get a first glimpse of what's in your DLQ, you can
                just put a JSP as silly as the following in your
                /server/default/deploy/jboss-web.deployer/ROOT.war/ ...

                <html>
                <body>
                <h1>DLQ contents</h1>
                <%
                 org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl storeImpl =
                 new org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl();
                
                 java.util.Map<java.net.URI, org.jboss.soa.esb.message.Message> map =
                 storeImpl.getAllMessages("DLQ");
                
                 for (org.jboss.soa.esb.message.Message msg : map.values())
                 {
                 if (msg.getBody().get()==null) continue;
                %>
                <pre>
                <%=msg.getBody().get().toString().replaceAll("<","<").replaceAll(">",">")%>
                </pre>
                <hr>
                <%
                 }
                %>
                
                </body>
                </html>
                


                Feel free to develop it from here, and post back your findings :-)