You need to be aware that multicast is sending a copy of the same incoming message. So the filter is either true or false for all the messages as they are from the same copy.
So in one case they are all odd, and in another case they are all even. And then they process about the "same time" and the order may appear as the same. If you want one of them to sleep for 1 sec and not the other you need to change your code. On Wed, Apr 1, 2015 at 2:38 PM, Christophe Pache <[email protected]> wrote: > Thanks Claus for your answer! I did test but did not succeed into making it > work as I wanted to (change the order of received message). Following your > advice, I've just added the streaming configuration to the multicast eip > such as following, is that correct? > > val croute = new org.apache.camel.builder.RouteBuilder { > override def configure(): Unit = { > from("direct:input").multicast().parallelProcessing().streaming(). > to("direct:even", "direct:odd").end() > > from("direct:odd").filter(body.isEqualTo(1)).to("mock:output") > > from("direct:even").filter(body.isEqualTo(0)). > process(new Processor { > override def process(exchange: Exchange): Unit = { > Thread.sleep(1000) > } > } > ). > to("mock:output") > } > } > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146p5765149.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
