4 Replies Latest reply on Jul 1, 2011 2:13 PM by everson .

    how do I get a DLQ message ?

    everson . Newbie

      I`m using <jms-jca-provider ../> and after to try 3 times for example and the error continue, the message is stored as DLQ message. How could I get the messages stored there ? Has ESB some api to do that ?



      A second question, is possible do the redelivery after a defined time ? Eg, after the esb get a message and get an exception in my action pipeline, it will try redelivery because i`m using jms-jca-provider, instead the message be processed after the exception, wait 2 minutes for example, and then try redelivery. I dont know if i was very clear ...

        • 1. Re: how do I get a DLQ message ?
          Hans Wolffenbuttel Expert

          hi Everson,


          Take a look at thread http://community.jboss.org/thread/167952 , it answers your second question.





          • 2. Re: how do I get a DLQ message ?
            Scott Dawson Apprentice


            Regarding your first question, see this forum thread: http://community.jboss.org/message/517185#517185


            John Pount attached a JSP that can retrieve DLQ messages (or other message types) from the message store.




            • 3. Re: how do I get a DLQ message ?
              everson . Newbie

              Hi hans and scott, your answers helped me .. thanks


              about my second question I saw the thread, but I didn't try yet...

              about my first one, it works. But I get some doubt about

              1-dlq message stored on database

              2-dlq message stored on jboss queue


              I would like to access the messages stored on queue/DQL, to try redelivery case necessary

              and for auditing(in this case transform the message to an object again. In my message I have an

              object like Person)


              Since I'm using jms-jca-provider every error in my action pipeline the message

              is sent to queue/DLQ on jboss to store a lost message


              My first steps to do that were:

              QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) iniCtx.lookup("ConnectionFactory");

              connection = queueConnectionFactory.createQueueConnection();

              queue = (Queue) iniCtx.lookup("/queue/DLQ");


              MessageConsumer consumer =  session.createConsumer(queue);

              ObjectMessageProxy omp = (ObjectMessageProxy) consumer.receive(2000);

              System.out.println( omp.getMessage());


              But the console show me: JBossMessage[21442936538595343]:PERSISTENT

              How can I convert it ?



              I didn't understand very well where I can use dlq message store on database, like:


              <action name="PersistAction" class="org.jboss.soa.esb.actions.MessagePersister">

                  <property name="classification" value="DLQ"/>

                  <property name="message-store-class"




              If I have code like below, the PersistAction always is stored. How can I use PersistAction just when error happen ?

              <action name="a1"    class="Action1"">

              <action name="a2"    class="Action2">

              <action name="a3"    class="Action3">

              <action name="PersistAction" class="org.jboss.soa.esb.actions.MessagePersister">



              With DLQ message stored on database, I can convert the message to my object:


              DBMessageStoreImpl storeImpl = new DBMessageStoreImpl();

              Map<URI, Message> map = storeImpl.getAllMessages("DLQ");

              Person person = null;

              for (org.jboss.soa.esb.message.Message msg : map.values()) {

              if (msg.getBody().get() != null){

              person = new Person();

              person = (Person) msg.getBody().get();// it works



              I think is more easily do what I want by dlq message stored on database

              • 4. Re: how do I get a DLQ message ?
                everson . Newbie

                Well,  can forget the message above ....


                I'm using the approach below to save a message using DBMessageStoreImpl,

                when I get err save the message as DLQ classification and ok as STORE.

                But I saved as RDLVR, and after couple minutes the classification was change to DLQ.

                Why did it happen ?


                <action name="notify" class="org.jboss.soa.esb.actions.Notifier">

                <property name="destinations">


                <NotificationList type="err">

                <target class="package.MyNotifyClass" ...


                <NotificationList type="ok">

                <target class="package.MyNotifyClass" ...