Apache camel:从多个频道进行轮询(比如2个pubsub主题),然后将消息汇总成一条消息。

问题描述 投票:1回答:1

你好,我正在努力寻找一个文档,在这个文档中,我可以轮询多个频道(比如说2个pubsub主题或2个文件或2个jms主题等),然后将消息合并成一个.我们的目的是将来自不同频道的多个消息汇总成一个消息。

我知道camel的聚合功能可以让我把多个消息合并成一个,但是当两个(或多个)消息来自不同的频道时,如何聚合。

Please point me to a linkdocumentation and I will figure out the rest.

谢谢manjith

apache-camel
1个回答
0
投票

你可以使用Segmented routes方法来实现它。这里我使用的是直接通道,但你也可以使用seda或vm。请注意

from("input-source-1").to("direct:composite-source"); 
from("input-source-2").to("direct:composite-source"); 

from("direct:composite-source")
    ....;

请看 https:/access.redhat.comdocumentationen-usred_hat_jboss_fuse6.3htmlapache_camel_development_guidebasicprinciples-multipleinputs。

请注意以下方法在camel 3中已被废弃。(https:/camel.apache.orgmanuallatestcamel-3-migration-guide.html。)

from("URI1", "URI2", "URI3").to("DestinationUri");

0
投票

Camel不像mule那样有一个复合消息源,你可以把消息源放在那里。所以你将不得不启动两条路由,然后将它们合并。

© www.soinside.com 2019 - 2024. All rights reserved.