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

    Dead letter Queue Listener

    roccoru

      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

       

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

       

       

       

      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"/>
          </actions>
         </service>

      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.