Apache Camel通过restlet将参数传递给multicust uri

时间:2015-11-18 08:13:56

标签: apache-camel dsl restlet

GroupedExchangeAggregationStrategy()的例子对我很好。但现在的挑战是将param值传递给uri。下面是代码。

from("restlet:http://localhost:8089/createCustomer/{foo}")      
.enrich("direct:serviceFacade")
.process(new Processor() {...})
.end();

from("direct:serviceFacade")
.multicast(new GroupedExchangeAggregationStrategy()).parallelProcessing()   
    .enrich("restlet:http://localhost:8080/CamelRest/rest/restService/addressInfo/${header.foo}").enrich("restlet:http://localhost:8080/CamelRest/rest/restService/accountInfo/${header.foo}")
.end();

我收到一条错误消息:

  

带密钥的标头:在Exchange中找不到header.foo。交换[消息:   [正文为空]]

1 个答案:

答案 0 :(得分:0)

最后我说得对。

from("direct:serviceFacade")
    .multicast(new GroupedExchangeAggregationStrategy()).parallelProcessing()       
     // .bean(RecipientListBean.class, "route")       
    .enrich("restlet:http://localhost:8080/CamelRest/rest/restService/addressInfo/{foo}")
    .enrich("restlet:http://localhost:8080/CamelRest/rest/restService/accountInfo/{foo}")
      .end();

那会有魔力......