简体   繁体   English

骆驼收件人列表如何转发邮件

[英]How the camel recipientList forward the messages

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 ie the thread that calls it will continue to process() . .from("direct:A")行为类似于java方法,即调用它的线程将继续process()

So what will happen in above case ? 那么在上述情况下会发生什么呢?

Let say Thread t1 calls from("direct:A") then 假设线程t1 from("direct:A")进行了调用

t1 will continue to process() t1将继续process()

and then t1 will enter into recipientList() 然后t1将进入recipientList()

Now from here on-wards will t1 call from("direct:B") and then call from("direct:C") synchronously 现在从这里开始, t1 from("direct:B")调用,然后from("direct:C")同步调用

or 要么

direct:b and direct:c will be called in two new thread asynchronously. direct:bdirect:c将在两个新线程中异步调用。

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. 请阅读其中的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM