【问题标题】:Camel send to multiple end points骆驼发送到多个端点
【发布时间】:2012-05-04 01:44:31
【问题描述】:

这两者有何不同

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

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

找不到第一个的任何文档

【问题讨论】:

    标签: apache-camel multicast


    【解决方案1】:

    是的,正如 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

    【解决方案2】:

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

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

    【讨论】:

    • 这很有帮助,谢谢
    • 没什么特别的原因,就是忘记点击了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-30
    • 2017-01-09
    相关资源
    最近更新 更多