Zyg*_*lis 4 java apache-camel eip
我有一个问题,并且不知道如何使用驼峰来解决它.我在骆驼文档中搜索了相关的EIP,但没有结果.
现在我有简单的路线:
<route id="routeId">
<from uri="Source1"/>
<from uri="Source2"/>
<to uri="Destination"/>
</route>
Run Code Online (Sandbox Code Playgroud)
两个源都将JMS消息发送到Destination,并且在Source完成其作业时,它会发送特定的结束消息,并带有一些标志.我需要做的是收集或计算这些结束消息,并在收到来自两个来源的最终消息时将单端消息发送到目的地.只有当我收到两个结束消息时(想象它只是简单的消息带有一些标题标志)然后我应该将单个消息发送到目的地.
对不起,如果问题解释不够清楚.
提前致谢.
像这样的东西......
from("source1").to("direct:aggregateRoute");
from("source2").to("direct:aggregateRoute");
from("direct:aggregateRoute")
.filter(header("isEndMessage").isEqualTo("true"))
.aggregate(constant(true), new MyAggregationStrategy())
.completionPredicate(new MyCompletionStrategy())
.to("destination");
Run Code Online (Sandbox Code Playgroud)
如果您只想从多个输入中进行选择并且不想对传入消息进行任何修改,您可以执行以下操作:
from("URI1", "URI2", "URI3").to("DestinationUri");
Run Code Online (Sandbox Code Playgroud)
欲了解更多信息,请查看此链接,它对我有帮助