Reputation: 17930
I'm using Jboss AS 7.1.1 and i need to see the messages that are in DLQ (Dead Letter Queue).
I tried writing a simple MDB for it:
@MessageDriven(messageListenerInterface = MessageListener.class, activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/queue/DLQ"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1") })
public class DLQMDB implements MessageListener{
public void onMessage(Message message) {
try {
process(message);
} ...
}
}
I wrote another MDB that throws error so the messages will do to the DLQ, but the DLQ MDB is never triggered.
I don't know if it is because there are no messages in the DLQ or the MDB is not defined correctly.
What am i doing wrong? Is there another way to see messages in the DLQ (like logging, admin interface)?
Upvotes: 2
Views: 3509
Reputation: 17930
Finally got it to work, I had a configuration problem:
<address-setting match="jms.queue.MetricEvents">
<dead-letter-address>jms.queue.MyQueue</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-delivery-attempts>0</max-delivery-attempts>
<max-size-bytes>10485760</max-size-bytes>
<address-full-policy>BLOCK</address-full-policy>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-setting>
once i removed :
<max-delivery-attempts>0</max-delivery-attempts>
everything is working.
Upvotes: 1