【发布时间】:2012-05-04 01:44:31
【问题描述】:
这两者有何不同
from(endpoint).to(endpoint:a, endpoint:b)
from(endpoint).multicast().to(endpoint:a, endpoint:b)
找不到第一个的任何文档
【问题讨论】:
这两者有何不同
from(endpoint).to(endpoint:a, endpoint:b)
from(endpoint).multicast().to(endpoint:a, endpoint:b)
找不到第一个的任何文档
【问题讨论】:
是的,正如 jarrad 所写,两者之间的区别是
首先是管道和过滤器 EIP(Camel 中的默认模式)。此处记录:https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html
第二个是多播 EIP,记录在这里: http://camel.apache.org/multicast.html
这里列出了所有 Camel EIP:http://camel.apache.org/eip
to(endpoint:a, endpoint:b) 等价于.to(endpoint:a).to(endpoint:b) 这意味着来自endpoint:a 的输出被发送到endpoint:b,而不是原来的Exchange。此外,每个端点一个接一个地执行。
.multicast() 将原始Exchange 发送到每个定义的端点,允许并行处理,并允许您定义一个AggregationStrategy 以确定如何组合来自原始Exchange 发送到的每个端点的响应。
【讨论】: