骆驼以路由外部休息Web服务



我正在使用Spring MVC工作,并使用Apache Camel集成了外部服务。我想使用Apache Camel路线进行网络服务调用。

喜欢我的本地休息服务(http://localhostsmiliex.xx:8080/用户)从外部休息服务(http://xxx:000/用户)获取数据,并希望提供外部数据的路由。

哪种Apache组件适用于捷式服务或生产者模板等网络服务路线?

您是否尝试过HTTP4或HTTP?http://camel.apache.org/http4.html

使用producerTemplate,它像呼叫外部终点,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>");

最新更新