0

The documentation at Camel HTTP4 is quite clear that you can set the following options for the HTTP4 component: connectionRequestTimeout, connectTimeout, and socketTimeout.

However, these are listed as general component options, not query options in the documentation (and are ignored if set as query options -- they just get passed onto the HTTP endpoint when called). So I'm not sure how to set them. The HTTPComponent class does not seem to have any setter methods for these options.

The documentation does have a section Using client timeout - SO_TIMEOUT, that links to unit test source where they set httpClient.soTimeout as a query option. However, when I try that I get an error:

Failed to resolve endpoint: https4://myhost/myapi/v1?bridgeEndpoint=true&httpClient.soTimeout=1000 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{soTimeout=1000}

1 Answer 1

4

It turns out that the documentation isn't quite right. All of those timeout parameters can be set via query param options, but they need to be prefixed with httpClient. . Here is what worked for me:

?httpClient.connectTimeout=10000&httpClient.connectionRequestTimeout=10000&httpClient.socketTimeout=30000

I verified by testing with ridiculously small values (1 ms) and it produced "read timed out" errors.

It looks the availble options for httpClient are the setter values on RequestConfig.Builder.

Sign up to request clarification or add additional context in comments.

1 Comment

The documentation needs some love for sure. Camel is changing fast so hard to keep everything up to date without some help. Will see if we can get this merged in to the docs somehow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.