Use options set on apache camel direct endpoint

好久不见. 提交于 2019-12-10 15:16:35

问题


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:


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



来源:https://stackoverflow.com/questions/14257499/use-options-set-on-apache-camel-direct-endpoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!