骆驼路由发送至多个终端点

21

这两者有何区别?

from(endpoint).to(endpoint:a, endpoint:b)

from(endpoint).multicast().to(endpoint:a, endpoint:b)

找不到第一个的任何文档

2个回答

33

to(endpoint:a, endpoint:b)等同于.to(endpoint:a).to(endpoint:b)。这意味着来自endpoint:a的输出被发送到endpoint:b,而不是原始的Exchange。此外,每个端点都是依次执行的。

.multicast()将原始Exchange发送到每个定义的端点,允许并行处理,并允许您定义一个AggregationStrategy来确定如何组装发送到原始Exchange的每个端点的响应。


没有特别的原因,只是忘记点击了。 - Manoj

10

1
http://camel.apache.org/pipes-and-filters.html 的链接已失效。 - hanzo2001
1
在这里:https://camel.apache.org/manual/latest/pipeline-eip.html - Claus Ibsen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接