Вопрос

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?

Это было полезно?

Решение

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

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top