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
Camel content based router with a lot of conditions
-
03-08-2022 - |
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?
Solution
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