manjit
manjit

Reputation: 69

Apache camel : poll from more than one channels (say 2 pubsub topic ) , and then summarize the messages into one message

Hi I am struggling to find a documentation where I can poll more than one channel (say 2 pubsub topic or 2 files or 2 jms topic etc.) and then combine the messages into one .The intention is to summarize the multiple messages from the different channels into one message.

I know aggregation in camel will allow me to combine more than one messages into one.But how to aggregate when the two(or more) messages are from different channel.

Please point me to a link/documentation and I will figure out the rest.

thanks manjith

Upvotes: 2

Views: 259

Answers (2)

user6878821
user6878821

Reputation:

Camel does not have a composite message source like mule where you can put sources. So you will have to start two routes and then merge them.

Upvotes: 0

you can achieve it using Segmented routes approach. Here I am using direct channel, but you can use seda or vm as well. Please note

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

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

See https://access.redhat.com/documentation/en-us/red_hat_jboss_fuse/6.3/html/apache_camel_development_guide/basicprinciples-multipleinputs

Please note the following approach is deprecated in camel 3. (https://camel.apache.org/manual/latest/camel-3-migration-guide.html)

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

Upvotes: 0

Related Questions