【问题标题】:Camel to route external REST web serviceCamel 路由外部 REST Web 服务
【发布时间】:2018-02-06 22:48:01
【问题描述】:
【问题讨论】:
标签:
spring-mvc
apache-camel
【解决方案1】:
使用 ProducerTemplate,它就像调用外部端点 REST、DB、SOAP 等的魅力。
你可以自动装配它
@Autowired
ProducerTempalete prodcuerTemplate
prodcuerTemplate.sendBody("http://xyz...", "<hello>world!</hello>");
或
ProducerTemplate template = exchange.getContext().createProducerTemplate();
// send to default endpoint
template.sendBody("<hello>world!</hello>");
// send to a specific queue
template.sendBody("http://xyz...", "<hello>world!</hello>");