I assume you checked that the messages were also put in the right order.? and also if you stop the consumer route, how do the messages look on the queue? Is 671a ahead of 671?
I understand that for yoru project processing in order is important but just from experience, requirements based on order tend to get very complicated and there are many situations to consider. If there is a way to change that it would be good for the long term. On Tue, Feb 23, 2016 at 10:17 AM, marco-dak [via Camel] <[email protected]> wrote: > Hi, > > 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" /> > <loop> > <constant>1000</constant> > > <c:setHeader headerName="testHeader"> > <simple>${property.CamelLoopIndex}</simple> > </c:setHeader> > <c:to uri="activemq:queue:DESTINATION-QUEUE" > pattern="InOnly"/> > > <c:setHeader headerName="testHeader"> > <simple>${property.CamelLoopIndex}a</simple> > </c:setHeader> > <c:to uri="activemq:queue:DESTINATION-QUEUE" > pattern="InOnly"/> > </loop> > </route> > > <route id="destinationRoute"> > <c:from uri="activemq:queue:DESTINATION-QUEUE" /> > <c:log message="$simple{header.testHeader}" /> > </route> > > 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 > order. > > It's very important for this project to process the messages send to > activemq:queue:DESTINATION-QUEUE in the correct order. > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://camel.465427.n5.nabble.com/Message-processed-in-wrong-order-tp5778100.html > To start a new topic under Camel - Users (activemq), email > [email protected] > To unsubscribe from Camel - Users, click here. > NAML -- View this message in context: http://camel.465427.n5.nabble.com/Message-processed-in-wrong-order-tp5778100p5778101.html Sent from the Camel - Users mailing list archive at Nabble.com.
