Java 正确使用驼峰聚合器“;至;URI
我有一条路线,我想让Camel访问以下bean:Java 正确使用驼峰聚合器“;至;URI,java,apache-camel,aggregation,Java,Apache Camel,Aggregation,我有一条路线,我想让Camel访问以下bean: 首先,loggingBean 第二,一个聚合器,它等待一定数量的消息在其上聚合 一旦达到聚合器的completionSize(3),继续执行#4 第三,processorBean 第四个/最后一个,finalizerBean 这是我的路线: <route id="my-camel-route"> <from uri="direct:starter" /> <to uri="bean:logging
loggingBean
聚合器,它等待一定数量的消息在其上聚合
completionSize
(3),继续执行#4processorBean
finalizerBean
<route id="my-camel-route">
<from uri="direct:starter" />
<to uri="bean:loggingBean?method=shutdown" />
<aggregate strategyRef="myAggregationStrategy" completionSize="3">
<correlationExpression>
<simple>${header.id} == 1</simple>
</correlationExpression>
<to uri="bean:processorBean?method=process" />
</aggregate>
<to uri="bean:finalizerBean?method=shutdown" />
</route>
基本上,我想知道我目前的方式是否会提示Camel将消息发送到聚合器,然后再将其发送到finalizerBean
(基本上是绕过聚合器)。在我的例子中,我希望它聚合到completionSize
为3,然后将聚合的交换发送到processorBean
,最后发送到finalizerBean
或者我已经正确地配置了这个?
finalizerBean
位于
元素内部与位于元素外部之间有什么区别?第二个示例是正确的
<aggregate strategyRef="myAggregationStrategy" completionSize="3">
<correlationExpression>
<simple>${header.id} == 1</simple>
</correlationExpression>
<to uri="bean:processorBean?method=process" />
<to uri="bean:finalizerBean?method=shutdown" />
</aggregate>
${header.id}==1
如果finalizerBean在
之外,那么它将对来自direct:starter
的每一条消息执行—这不是您想要的;) 我们如何使用JavaDSL表达同样的东西?aggregate()。
<aggregate strategyRef="myAggregationStrategy" completionSize="3">
<correlationExpression>
<simple>${header.id} == 1</simple>
</correlationExpression>
<to uri="bean:processorBean?method=process" />
<to uri="bean:finalizerBean?method=shutdown" />
</aggregate>