简体   繁体   English

骆驼HTTP组件似乎死机了

[英]Camel HTTP Component seems to freeze

Can anyone explain why the following route simply blocks? 谁能解释为什么以下路线会简单地阻塞?

from("restlet:http://127.0.0.1:8081/nextbus/test")
                .setHeader(Exchange.HTTP_METHOD, constant("GET"))
                .to("http://webservices.nextbus.com/service/publicXMLFeed?command=routeList&a=charm-city")
                .process(new Processor() {

                    public void process(Exchange arg0) throws Exception {
                        // Do more stuff.
                    }
                });

If I remove the invocation to call the next bus web service then everything is fine. 如果删除调用下一个总线Web服务的调用,那么一切都很好。

Or if I create a route that is from the web service, also fine. 或者,如果我创建来自Web服务的路由,也可以。

Solved this after some painful debugging. 经过一些痛苦的调试后解决了这个问题。

Looks like the restlet headers interfere with the http headers. 看起来restlet标头会干扰http标头。 The following works... 以下作品...

<route>
        <from uri="restlet:http://0.0.0.0:8081/nextbus/{agency}/{command}" />
        <setHeader headerName="CamelHttpMethod">
            <constant>GET</constant>
        </setHeader>
        <removeHeader headerName="CamelHttpUri" />
        <recipientList>
            <simple>http://webservices.nextbus.com/service/publicXMLFeed?command=${header.command}&amp;a=${header.agency}</simple>
        </recipientList>            
</route>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM