0
votes

I am using Apache Camel route for HTTP call. I wanted to add timeout if there is delay from host system. I am using the following configuration but it is not working. The client request is getting timeout without waiting host system timeout. The client timeout is configured in CXF but the camel timeout is configured in camel route. It should timeout in 4 second and it should go to error processor and but it is not happening.

HTTP

<setHeader headerName="CamelHttpQuery">
    <constant>httpclient.soTimeout=4000&amp;bridgeEndpoint=true&throwExceptionOnFailure=false</constant>
<setHeader>

HTTP4

<setHeader headerName="CamelHttpQuery"><constant>httpclient.socketTimout=4000&amp;bridgeEndpoint=true&throwExceptionOnFailure=false</constant>
<setHeader>

Thanks

1
you might have a syntax error in the header . httpclient.soTimout ?Hassam Abdelillah
I posted wrongly. It should be httpclient.soTimeout. I am still getting same issue.Kathees
Also. Is there any reason you put &amp; instead of & in the query ?Hassam Abdelillah
Because he is using XML route definition and "&" should be escapedc0ld

1 Answers

0
votes

Please be attentive for syntax. Correct spelling

httpClient.socketTimeout=4000&amp;bridgeEndpoint=true&amp;throwExceptionOnFailure=false

But even after correcting parameters it will not work. Instead of configuring http endpoint you send your parameters as query string of request to server. For set up endpoint just add your parameters to it and use CamelHttpQuery header for request parameters.