Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use options set on apache camel direct endpoint

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?

like image 264
Panayiotis Avatar asked Nov 03 '22 07:11

Panayiotis


1 Answers

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").

like image 127
Kevin Avatar answered Nov 15 '22 09:11

Kevin