Managing dead messages

A message is considered “dead” when repeated attempts to receive the message fail and the transactions roll back.

You can specify transaction retry parameters in the Ant configuration script that defines the message listener; for example:

             <setProperties component="ejb.components.mymodule.MyListener">
                 ...
                 <transaction retry="true" retryCount="5" retryDelay="60"/>
              </setProperties>

Dead messages for a message queue named xxx are moved to a message queue named deadMessages:xxx. To view the messages in a deadMessages:xxx queue, you can use the JMS API QueueBrowser (see “Browsing messages”). To move a message from deadMessages:xxx to another message queue:

  1. Obtain a transacted session (see “Creating sessions”).

  2. Receive the message from deadMessages:xxx (see “Receiving messages”).

  3. Acknowledge the message.

  4. If the message should be recovered, send it to the xxx message queue; otherwise, send it to any message queue (see “Sending messages”).

  5. Commit the transacted session.

You can download the JMS 1.1 API Specification from the JMS Download site.

To check the message store for dead (persistent) messages, you can run an SQL query, such as:

select pm_qid, count(*) from jms_pm 
where pm_qid like '%' 
group by pm_qid