Re: AW: Dynamic routing based on collection values

2016-10-29 Thread Brad Johnson
@Steve I'm fairly certain the ProducerTemplate is simply an object and doesn't have its own separate thread. That would create a lot of different problems given the nature of the methods on the ProducerTemplate and the @EndpointInject. Even when you make async calls using it the PT uses an

Re: AW: Dynamic routing based on collection values

2016-10-26 Thread raghavender.anth...@gmail.com
Thanks a ton everyone, I was able to achieve it by using split and by writing a custom bean/method. -- View this message in context: http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157p5789282.html Sent from the Camel - Users mailing list archive at

Re: AW: Dynamic routing based on collection values

2016-10-24 Thread Steve973
And, by default, that is a lot of threads that are not needed for his use case. Though I am not sure how many threads are created vs used when you are doing a recipient list and a splitter. On Mon, Oct 24, 2016 at 2:51 PM, Brad Johnson wrote: > How many producer

Re: AW: Dynamic routing based on collection values

2016-10-24 Thread Brad Johnson
How many producer templates would be produced? There's only a single handler instantiated so if there are 5 routes that's 5 producer templates. On Mon, Oct 24, 2016 at 1:32 PM, Steve973 wrote: > I'd worry about the overhead of creating so many producer templates. I > would

Re: AW: Dynamic routing based on collection values

2016-10-24 Thread Steve973
I'd worry about the overhead of creating so many producer templates. I would probably set a header that contains a map of keys to destinations, then you could set a recipient list of one endpoint that contains the value at that key. Maybe brad's method isn't as overhead intensive because the

Re: AW: Dynamic routing based on collection values

2016-10-24 Thread Brad Johnson
This is also one of those fuzzy areas where sometimes it is easier to simply pass the message body into a bean and then use ProducerTemplate instances to send values us different routes. Under normal circumstances I wouldn't do it that way as Camel does a great job of heavy lifting. But in some

Re: AW: Dynamic routing based on collection values

2016-10-24 Thread raghavender.anth...@gmail.com
Thanks a lot for the response. This seems like useful, I'll give out a try and will update you accordingly. Best, Raghavender Anthwar -- View this message in context: http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157p5789179.html Sent from the Camel -

AW: Dynamic routing based on collection values

2016-10-24 Thread jhm
Here an example what I unterstood. Jan package de.materne.camel; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; import org.apache.camel.EndpointInject; import org.apache.camel.RoutesBuilder; import org.apache.camel.builder.RouteBuilder; import

Re: AW: Dynamic routing based on collection values

2016-10-24 Thread raghavender.anth...@gmail.com
Basically I've the map that was mentioned in the post as input in the incoming message. And I wanted to iterate over each key of the map and send it as input to different endpoint based on the key value. Yes, it's kind of content based routing but the content is a collection here. -- View this

AW: Dynamic routing based on collection values

2016-10-24 Thread jhm
So you want to split [1] the list into Key-Value-Pairs and do a content based routing [2]? Jan [1] http://camel.apache.org/splitter.html [2] http://camel.apache.org/content-based-router.html > -Ursprüngliche Nachricht- > Von: raghavender.anth...@gmail.com >