【问题标题】:Parallel in Apache Camel AggregatorApache Camel 聚合器中的并行
【发布时间】:2019-04-08 06:44:56
【问题描述】:

我有如下骆驼路线配置:

from("seda:logCall?concurrentConsumers=50")
                    .aggregate(header("EXCHANGE_ID"), new CustomAggregator())
                    .completionSize(2)
                    .parallelProcessing()
                    .to("bean:someAdapter?method=someMethod");

我想要实现的是一直并行处理意味着消息应该由聚合器和 bean 并行处理(聚合后)。但是,当我调试时,我看到了聚合块(在单个线程中运行)。 Bean并行处理消息所以没问题。

我应该如何配置聚合器以并行聚合传入的消息?

【问题讨论】:

    标签: apache-camel spring-camel


    【解决方案1】:

    你可以试试

    from("seda:logCall?concurrentConsumers=50") .threads().executorService(Executors.newCachedThreadPool()) .aggregate(header("EXCHANGE_ID"), new CustomAggregator()) .completionSize(2) .parallelProcessing() .to("bean:someAdapter?method=someMethod");

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-22
    • 1970-01-01
    • 2023-03-08
    • 2014-10-10
    • 2014-01-01
    • 1970-01-01
    相关资源
    最近更新 更多