Reputation: 1239
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.
Or if I create a route that is from the web service, also fine.
Upvotes: 0
Views: 496
Reputation: 1239
Solved this after some painful debugging.
Looks like the restlet headers interfere with the http headers. 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}&a=${header.agency}</simple>
</recipientList>
</route>
Upvotes: 1