骆驼http端点动态形成url [英] camel http endpoint forming url dynamically

查看:20
本文介绍了骆驼http端点动态形成url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用的家伙

{
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>
}

这个 url 会在每次请求路由时改变.

and this url will change on every request to the route.

我已经尝试过的.将参数作为标题传递并尝试使用 header("test") 和使用 ${in.header.test} 在路由中访问似乎都不起作用.

What i have already tried. Passing params as headers and try to access in the route using the header("test") and using ${in.header.test} both doesn't seem to work.

任何建议都会非常有帮助.

any suggestions will be greatly helpful.

推荐答案

请参阅有关 Camel 中动态到端点的常见问题解答:https://camel.apache.org/manual/latest/faq/how-to-use-a-dynamic-uri-in-to.html

See this FAQ about dynamic to endpoints in Camel: https://camel.apache.org/manual/latest/faq/how-to-use-a-dynamic-uri-in-to.html

这篇关于骆驼http端点动态形成url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆