0 Replies Latest reply on Jan 5, 2011 11:38 AM by Rocco Rufus

    Dead letter Queue Listener

    Rocco Rufus Newbie

      Hi there.


      I have a simple quention that I was not able to find...


      How can I define a DeadLetterService Listener?


      I'm able to control the messages stored in the dead letter queue:


      MessageStore ms = MessageStoreFactory.getInstance().getMessageStore();
      Map<URI, Message> messages = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);


      To test this code I use an action related to a specific queue listener.

      The queue where jms messages arrive is defined by jboss-esb.xml


        <jms-provider connection-factory="ConnectionFactory" name="JBossMQ">
         <jms-bus busid="outChannel">
          <jms-message-filter dest-name="queue/out" dest-type="QUEUE"/>
        <service category="MainServiceESB" description="Hello World" name="MainListener">
          <jms-listener busidref="outChannel" is-gateway="true" name="JMS-Gateway"/>
         <actions mep="OneWay">
          <action class="org.cooperative.publish.MyJMSListenerAction"
           name="publish" process="publishPost"/>




      I hoped that adding something like


      <service category="JBossESB-Internal" description="DeadLetterService" name="DeadLetterService">
          <actions mep="OneWay">
           <action class="org.cooperative.actions.MyAction"
            name="getDeadMessages" process="getDeadMessages"/>

      could solve my problem, but the method  getDeadMessages is not called at all.


      So my question is: what is the standard way to define a Dead Letter Queue Listener assuming that JBoss has a standard configuration for the DLQ ?



      Thanks in advance.