activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From frankie_hr <>
Subject Problem using custom defined deadletter queue
Date Tue, 21 Dec 2010 08:37:33 GMT

Hi everybody,

I have an issue using the ActiveMQ with Camel's dead letter channel error
handler. The error handler is defined as follows:

                .onRedelivery(new RedeliveryProcessor())
                .maximumRedeliveryDelay(1000L * 60 * 5));

The camel route is defined as:

    public static final String BEAN = "bean:";
    public static final String METHOD = "?method=";

            .to(BEAN + "handler" + METHOD + "printType")
            .to(BEAN + "handler" + METHOD + "doesNothing")
            .to(BEAN + "handler" + METHOD + "printType")
            .to(BEAN + "handler" + METHOD + "returnsListOfB")
            .to(BEAN + "handler" + METHOD + "printType")
            .aggregationStrategy(new UseLatestAggregationStrategy())
            .to(BEAN + "handler" + METHOD + "throwsException");

where the methods do exactly what their names say. Class B is serializable
and the method "returnsListOfB" returns a list with 3 elements of type B.
After the splitter, there should be 3 individual objects of type B entering
the "throwsException" method, which is designed to throw a
NullPointerException. At the begining of the "throwsException" there is a
logging statement, so I can see that the method is being entered 4 times
(original attempt + 3 retries) for each of the 3 objects of type B.

Since I'm using the dead letter channel error handler and have defined a
DEADLETTER queue, I would expect those 3 objects of type B to eventually end
up in the DEADLETTER queue. This is exactly what happens, but only for a
brief moment. The messages that are eventually queued on a DEADLETTER queue
get dequeued and put onto the default ActiveMQ.DLQ. By the time the JUnit
test finishes, there are two messages on the ActiveMQ.DLQ and only one left
on the DEADLETTER queue. Now the biggest apsurd is that about 30 seconds
after the JUnit test finishes and JVM shuts down, the last message somehow
gets queued to the ActiveMQ.DLQ as well. I'm able to track the queue/dequeue
count by connecting to localhost:8161 from the Internet browser.

Does anybody have any idea why is this happening and how to prevent the
default deadletter queue ActiveMQ.DLQ from taking the mesasges from my
custom defined DEADLETTER queue? Is there some kind of known bug?

The version of Camel I'm using is 2.2.0 and ActiveMQ is 5.3.2.

Thank you for your answers!

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message