【发布时间】:2018-09-29 05:51:22
【问题描述】:
下面是我的路线
from("activemq:queue:request")
.routeId("urlRoute")
.setExchangePattern(ExchangePattern.InOut)
.convertBodyTo(String.class)
.to("http://mydomain:8080/my-bin/myProgram.pgm?xmlData=<head><user>username</user><pass>password</pass><data>Some data</data></head>")
.process(new Processor() {
public void process(Exchange e) throws Exception {
log.info("Response : "+MessageHelper.extractBodyAsString(e.getIn()));
}
})
.to("activemq:queue:response")
上述路由工作正常,因为 to 端点是用 http 端点中的 xml 数据硬编码的......如果我用 ${body} 替换 xml 数据,它不会像下面那样工作。
.to("http://mydomain:8080/my-bin/myProgram.pgm?xmlData=${body}")
我做得对吗?还是必须定义某些数据类型?请帮帮我..
【问题讨论】:
标签: xml http apache-camel apache-servicemix