5
votes

I am building a routing slip bean and want to apart from the dynamic routing also to send a parameter to the endpoints of the recipients list.

I wish to use something like "direct:test?param=value", where param and value are set inside the routing slip POJO

From what I understand from the direct component, a single "direct:test" endpoint will receive all the routed exchanges, however I need a way to read the param send from the routing slip

How can I use this param to the endpoint which receives the exchange? Is it a property of the exchange?

1
after some testing, setting params on a direct endpoint such as "direct:test?para=value" does not seem to work as direct does not know how to handle those params, from what I understand a custom endpoint is needed. - Panayiotis

1 Answers

2
votes

Pan,

I'd use the header functionality of camel. It's quite versatile and you can handle it using predicates for some nice DSL or spring control, or in a bean/processor by doing myExchange.getIn().getHeader("foo").