4

私が使おうとしている人

{
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 は、ルートへのリクエストごとに変更されます。

私がすでに試したこと。パラメータをヘッダーとして渡し、header("test") と ${in.header.test} を使用してルートにアクセスしようとすると、両方とも機能しないようです。

どんな提案も非常に役に立ちます。

4

3 に答える 3

6

camel 2.16から、次のようなことができます-

from("direct:start")   
   .toD("${header.foo}");

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

于 2016-04-13T04:32:00.870 に答える
4

Camel の動的エンドポイントに関するこの FAQ を参照してください: https://camel.apache.org/manual/latest/faq/how-to-use-a-dynamic-uri-in-to.html

于 2013-02-25T17:43:08.957 に答える
2

キャメルプロパティのプレースホルダーを使用できます

http://camel.apache.org/using-propertyplaceholder.html

<camelContext trace="false" xmlns="http://camel.apache.org/schema/spring">
    <propertyPlaceholder location="config/AuditJMSConfig.properties" id="properties" />
    <route id="crudRoute">
        <from uri="activeMQ:queue:{{speedwing.activemq.auditqueue}}/>
    </route>                                                                                    where speedwing.activemq.auditqueue is the property name defined in the peroperties file.

同じものを使用できます<to uri="" also

于 2014-01-24T07:47:44.797 に答える