如何使用apache camel调用外部web服务url



如何从apache camel的外部web服务url获取数据例如,从这个urlhttps://maps.googleapis.com/maps/api/geocode/json?address=1600AmphitheatreParkway

您应该查看http组件。例如:

    from("direct:start")
    .to("http://maps.googleapis.com/maps/api/geocode/json?address=1600AmphitheatreParkway")
    .convertBodyTo(String.class)
    .to("log:logOut");

此路由将在每次向direct:start组件发送消息时请求web服务。要使用回复,只需在您的路径结束时更改log

最新更新