Manoj
Manoj

Reputation: 5612

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

Upvotes: 21

Views: 10517

Answers (2)

Claus Ibsen
Claus Ibsen

Reputation: 55585

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

Upvotes: 10

jarrad
jarrad

Reputation: 3292

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.

Upvotes: 33

Related Questions