Places redeliveded messages on a Dead Letter Queue.
The Dead Letter Queue handler is used to not set JBoss in an endles loop
when a message is resent on and on due to transaction rollback for
message receipt.
It sends message to a dead letter queue (configurable, defaults to
queue/DLQ) when the message has been resent a configurable amount of times,
defaults to 10.
The handler is configured through the element MDBConfig in
container-invoker-conf.
The JMS property JBOSS_ORIG_DESTINATION in the resent message is set
to the name of the original destination (Destionation.toString()).
The JMS property JBOSS_ORIG_MESSAGEID in the resent message is set
to the id of the original message.
Created: Thu Aug 23 21:17:26 2001
public static final java.lang.String JBOSS_ORIG_DESTINATION
JMS property name holding original destination.
JBOSS_ORIG_MESSAGEID
public static final java.lang.String JBOSS_ORIG_MESSAGEID
JMS property name holding original JMS message id.
Constructor Detail
DLQHandler
public DLQHandler()
Method Detail
handleRedeliveredMessage
public boolean handleRedeliveredMessage(javax.jms.Message msg)
Check if a message has been redelivered to many times.
If message has been redelivered to many times, send it to the
dead letter queue (default to queue/DLQ).
Returns:
true if message is handled, i.e resent, false if not.
incrementResentCount
protected int incrementResentCount(java.lang.String id)
Increment the counter for the specific JMS message id.