Question

I have a message with a certain value (e.g. 100, 101) in header and I need to take a specific action depending on that value.

I know I can write a route with when / otherwise branches for content-based routing. My question is: what if I have about 400 different cases? Is there a best practice in these cases to manage the routing?

Was it helpful?

Solution

Yes use recipient list instead which can compute the endpoint dynamically - eg its a dynamic to. See this FAQ link for further details: http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

OTHER TIPS

another option is to use a ProducerTemplate to send messages to any endpoint from a POJO class, just need to inject/pass in a handle to the CamelContext, etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top