Question

from("direct:A")
    .process(//processing here)
            .recipientList(//expression that return two recipients [direct:B, direct:C] )

from("direct:B")
    .process(//processing here)...


from("direct:C")
    .process(//processing here)...

.from("direct:A") behaves like a java method i.e the thread that calls it will continue to process().

So what will happen in above case ?

Let say Thread t1 calls from("direct:A") then

t1 will continue to process()

and then t1 will enter into recipientList()

Now from here on-wards will t1 call from("direct:B") and then call from("direct:C") synchronously

or

direct:b and direct:c will be called in two new thread asynchronously.

Was it helpful?

Solution

Read the recipient list documentation for a lot more detail. By default it processes messages synchronously. You can use the parallel processing feature of the recipient list to run this concurrently. You can also define your own thread pools.

Go read the documentation it is in there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top