activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marco-dak <>
Subject Message processed in wrong order
Date Tue, 23 Feb 2016 09:54:08 GMT

I encounter an issue with Camel (2.13) and ActiveMQ (5.11.1) on JBoss EAP
(6.1) where messages are processed in wrong order. It only occurs if there
are a lot of messages send to a single queue.

I can reproduce it with a very simple example:

<route id="sendRoute">
        <c:from uri="activemq:queue:START-QUEUE" />

                <c:setHeader headerName="testHeader">
                <c:to uri="activemq:queue:DESTINATION-QUEUE"
                <c:setHeader headerName="testHeader">
                <c:to uri="activemq:queue:DESTINATION-QUEUE"

<route id="destinationRoute">
        <c:from uri="activemq:queue:DESTINATION-QUEUE" />
        <c:log message="$simple{header.testHeader}" />

I'm starting this example by sending a message to activemq:queue:START-QUEUE
via ActiveMQ console.

In the first route I set the loop index to the header and send it to
activemq:queue:DESTINATION-QUEUE. Than I overwrite the header by adding an
"a" to the loop index and send it also to activemq:queue:DESTINATION-QUEUE.

In the second route there is only one consumer reading messages from
activemq:queue:DESTINATION-QUEUE and log the header value that was set in
the first route.

I assumed that for the same index (e.g. 671) it should always logged before
the index containing the "a" (e.g. 671a), but it doesn't.

For example I got the following output in log:
08:17:49,666 INFO  [destinationRoute] 671a
08:17:52,385 INFO  [destinationRoute] 671

Why are the messages processed in the wrong order?
Is there any way to make sure that messages (for the same index) are always
procssed in the correct order?

If it not occurs if you run this example the first time, run it again.
Mostly it occurs after the first 200 messages are procssed in the correct

It's very important for this project to process the messages send to
activemq:queue:DESTINATION-QUEUE in the correct order.

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

View raw message