0
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")行为就像一个Java方法,即调用它会继续process()线程。骆驼如何recipientList转发消息

那么在上述情况下会发生什么?

我们说线程t1电话from("direct:A")然后

t1将继续process()

,然后t1会从这里开始,病房会t1呼叫from("direct:B")进入recipientList()

现在,然后调用from("direct:C")同步

direct:bdirect:c将在两个新线程中被异步调用。

回答

0

阅读the recipient list文档了解更多详情。默认情况下,它同步处理消息。您可以使用收件人列表的并行处理功能同时运行此功能。你也可以定义你自己的线程池。

请阅读它所在的文档。