【发布时间】:2014-01-30 13:30:55
【问题描述】:
我有一条路线,希望 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 放在 <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>
基本上,我想知道我目前的处理方式是否会提示 Camel 将消息发送到聚合器,然后也将其发送到 finalizerBean(本质上是绕过聚合器)。在我的情况下,我希望它聚合到 completionSize 为 3,然后 然后 将聚合交换发送到 processorBean,然后最后发送到 finalizerBean。
或者我是否正确配置了这个? finalizerBean 在 <aggregate> 元素内部与在它外部有什么区别?
【问题讨论】:
标签: java apache-camel aggregation