camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "pmp.martins" <pmp.mart...@campus.fct.unl.pt>
Subject Difference between multicast and recipent-list ?
Date Sun, 10 Nov 2013 12:42:00 GMT
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.

Mime
View raw message