camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Reynolds <>
Subject Re: how to route a single message to multiple MessageGroups?
Date Fri, 21 May 2010 05:15:28 GMT

>You can send them one at a time and change the JMSXGroupID.
>Or you can use a bean to send the messages from java code using the
>ProducerTemplate to do that in one line of code.
>Then you can set/change the JMSXGroupID in Java code.

Thanks, Claus.  I ended up using the loop DSL, and it looks like the
messages are created properly on the queue with the proper JMSXGroupID
header property.
However, now when I attempt to process them, they are all being processed in
a pipeline (serial).  And if I set it to async, the rules of MessageGroups
don't seem to apply (i.e. multiple messages in MessageGroupA get processed

Here is my route:

activemq:personnel.records_sink is my source to start the process
I have it looping three times (for testing)
pushModeProcessor bean adds the appropriate header: 
exchange.getIn().setHeader("JMSXGroupID", groupName);
pushModeAgentQueue is the queue that holds the message
pushEventToAgent bean simply waits for a time (depending on the groupName)
and prints out a message.

Am I missing something obvious?
On my console, I can see that the message in group 1 is processed (10
seconds), and then message in group 2 (5 seconds), and then 1 (1 second).  I
would expect to see group 1 start, group 2 start, group 3 start, group 3
complete, group 2 complete, and finally group 1 complete.
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message