Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Multithreading camel recipientList如何转发消息_Multithreading_Routing_Apache Camel_Messaging_Integration Patterns - Fatal编程技术网

Multithreading camel recipientList如何转发消息

Multithreading camel recipientList如何转发消息,multithreading,routing,apache-camel,messaging,integration-patterns,Multithreading,Routing,Apache Camel,Messaging,Integration Patterns,.from(“direct:A”)的行为类似于java方法,即调用它的线程将继续执行process() 那么在上述情况下会发生什么呢 假设线程t1从(“direct:A”)调用, t1将继续process() 然后t1将进入recipientList() 现在,从这里开始,wards将t1从(“direct:B”)调用,然后从(“direct:C”)同步调用 或 direct:b和direct:c将在两个新线程中异步调用。有关更多详细信息,请阅读文档。默认情况下,它同步处理消息。您可以使用收件人

.from(“direct:A”)
的行为类似于java方法,即调用它的线程将继续执行
process()

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

假设线程
t1
从(“direct:A”)调用

t1
将继续
process()

然后
t1
将进入
recipientList()

现在,从这里开始,wards将
t1
从(“direct:B”)调用
,然后从(“direct:C”)同步调用

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

有关更多详细信息,请阅读文档。默认情况下,它同步处理消息。您可以使用收件人列表的并行处理功能并行运行此操作。您还可以定义自己的线程池

去看看里面的文件

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)...