Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Camel send to multiple end points

How does these two differ

from(endpoint).to(endpoint:a, endpoint:b)

from(endpoint).multicast().to(endpoint:a, endpoint:b)

couldn't find any documentation for the first

like image 609
Manoj Avatar asked Apr 23 '12 12:04

Manoj


2 Answers

to(endpoint:a, endpoint:b) is equivalent to .to(endpoint:a).to(endpoint:b) This means that the output from endpoint:a is sent to endpoint:b, not the original Exchange. Also, each endpoint is executed one after the other.

.multicast() sends the original Exchange to each defined endpoint, allows for parallel processing, and allows you to define an AggregationStrategy to determine how to assemble the responses from each endpoint the original Exchange was sent to.

like image 186
jarrad Avatar answered Oct 04 '22 02:10

jarrad


Yeah as jarrad writes the difference between the two are

The first is the pipes and filters EIP (default mode in Camel). Which is documented here: https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html

The 2nd is the multicast EIP which is documented here: http://camel.apache.org/multicast.html

All the Camel EIPs is listed here: http://camel.apache.org/eip

like image 41
Claus Ibsen Avatar answered Oct 04 '22 03:10

Claus Ibsen