我想让Camel访问以下bean:
loggingBean
aggregator
等待一定数量的邮件汇总在其上completionSize
(3),继续进行#4 processorBean
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>
我的问题:我是否需要将finalizerBean
置于<{1}}元素内,如下所示:
<aggregate>
基本上,我想知道我目前有什么方法会提示Camel将消息发送给聚合器,然后还将其发送到<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>
(基本上,绕过聚合器)。在我的情况下,我希望它汇总到finalizerBean
为3,然后将汇总的交易所发送到completionSize
,然后最后processorBean
。
或者我是否正确配置了这个? finalizerBean
元素在finalizerBean
元素内部与外部元素之间有什么区别?
答案 0 :(得分:1)
第二个例子是正确的。
<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>
如果finalizerBean在<aggregate>
“之外”,则会对来自direct:starter
的每条消息执行 - 这不是您想要的;)