They are 2 different eip patterns. recipient list is dynamic as it computes the endpoints at runtime based on an expression. multicast is static where you define the endpoints at design time
They both send a copy of the same message to N+ destinations. Recipient list can send to 0 .. N endpoints, eg for 1 you can use it as the dynamic to http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html Where as multicast is static and defined beforehand which endpoints to send to. They can both run in sequential order (by default) but you can enable parallel. And they can both also aggregate etc. In fact under the hood they are sharing the same code base. On Sun, Nov 10, 2013 at 1:42 PM, pmp.martins <[email protected]> wrote: > So, after reading some documentation and getting a lot of help from you guys > here, I finally implemented a recipient list that choose the endpoints > dynamically (a dynamic recipient list): > http://camel.apache.org/recipient-list.html > http://camel.apache.org/recipientlist-annotation.html > > In my code, MainApp_A generates reports every 10 seconds, and I want it to > send the reports to all the servers at the same time, instead of doing it > one by one. Thus I have developed the following route. > > //MainApp_A > > main.addRouteBuilder(new RouteBuilder(){ > @Override > public void configure() throws Exception { > > from("direct:start").multicast().parallelProcessing() > .beanRef("recipientListBean", "route").end() > .log("${body}"); > } > > }); > > > //RecipientListBean > > @RecipientList > public Set<String> route(String body) { > return servers; //returns a collection of several severs > } > > ----- > > I also checked the documentation for the Multicast pattern and the Dynamic > route: > http://camel.apache.org/multicast.html > http://camel.apache.org/dynamic-router.html > > Now I have a few questions and I am confused. So I have a few questions: > 1 - Is the recipient dynamic list simply the junction of the Multicast > pattern with the Dynamic Route Pattern? > 2 - the multicast() call alone is purely sequential right? What is the > difference between using multicast() and recipientList()? > 3 - For both multicast() and recipientList() to be concorrent I have to use > parallelProcessing(). In my case, which is more efficient? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Difference-between-multicast-and-recipent-list-tp5742958.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
