Thanks, You are true.
Sorry, I should have pasted the code where I send exchanges again.
List(0, 1, 0, 1, 0, 1, 0, 1, 0, 1).foreach(x =>sendBody("direct:input", x))
I'm sending 10 exchanges. I hope I'll receive 10 in the end and I'm not
expecting aggregation in fact. I've controlled each sub route sends 5
exchanges to the final mock endpoint.
I receive 10 exchanges but this is just the order which interests me on this
case.
>From what I understand, this is the aggregation of results that I should
make parallel to get the odd results faster than the even one. I'm fine with
that, I would just find a way to be sure the processing (in the sub routes)
is done in parallel.
I've had a look to MultiCastParallelAndStreamCachingTest.java
<https://github.com/apache/camel/blob/master/camel-core/src/test/java/org/apache/camel/processor/MultiCastParallelAndStreamCachingTest.java
> but did not find tests that validate it yet.
My latest try was to print iteratively in both sub route to prove the print
may occur at the same time, but did not succeed:
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)).
process(new Processor {
override def process(exchange: Exchange): Unit = {
(1 to 10).foreach(x => {
Thread.sleep(100)
println("odd")
})
}
}
).to("mock:output")
from("direct:even").filter(body.isEqualTo(0)).
process(new Processor {
override def process(exchange: Exchange): Unit = {
(1 to 10).foreach(x => {
Thread.sleep(100)
println("even")
})
}
}
).
to("mock:output")
}
}
--
View this message in context:
http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146p5765151.html
Sent from the Camel - Users mailing list archive at Nabble.com.