This content has been marked as final.
Show 2 replies
-
1. Re: Dynamic Routing decision in dependence of message-body content (Camel)
janstey Jan 28, 2009 1:58 PM (in response to airber)You can do this easily with the RecipientList annotation. For example,
public class MyRouterBean { @RecipientList public String route(String body) { String queueName = ... // do your reg ex check on the body here return "activemq:" + queueName; } } public class MyRouteBuilder extends RouteBuilder { protected void configure() { // assuming MyRouterBean is registered as a Spring bean or via JNDI as myRouterBean from("direct:startOfRoute").beanRef("myRouterBean", "route"); } }
Also the queues are created dynamically so your next requirement is good too.
Cheers,
Jon
-
2. Re: Dynamic Routing decision in dependence of message-body content (Camel)
airber Jan 29, 2009 4:35 AM (in response to airber)It works fine.
Thanks a lot
airber