骆驼http端点动态形成url

Sub*_*pta 3 url http dynamic apache-camel endpoint

我正在尝试使用的家伙

{
from("direct:a").to (someUrl).processor(new Processor(){

   @Override
   public void process(Exchange arg0) throws Exception
   {
      // do something
   }

});


where someUrl is of the type http://xyz.com/{id}?test=<value1>&test1=<value2>
}
Run Code Online (Sandbox Code Playgroud)

该网址将在对路由的每次请求中更改。

我已经尝试过的。将参数作为标头传递并尝试使用header(“ test”)和$ {in.header.test}来访问路由似乎都无效。

任何建议将大有帮助。

Gop*_*opi 6

在骆驼2.16中,您可以执行以下操作-

from("direct:start")   
   .toD("${header.foo}");
Run Code Online (Sandbox Code Playgroud)

请参阅:http : //camel.apache.org/message-endpoint.html