allthingssecurity opened a new pull request, #27325: URL: https://github.com/apache/camel/pull/27325
# Description [CAMEL-25294](https://issues.apache.org/jira/browse/CAMEL-25294) `ConsulClientConfiguration.createConsulClient` (all consul endpoints and `ConsulClusterService`) passed `readTimeout` and `writeTimeout` to `withConnectTimeoutMillis`, a copy and paste from CAMEL-14878 (2020). So the read and write timeouts were always OkHttp's default 10 seconds, whatever was configured, and the connect timeout was `writeTimeout` when it was set, otherwise `readTimeout`, otherwise `connectTimeout`. This change calls `withReadTimeoutMillis` and `withWriteTimeoutMillis`. Blocking queries are not affected: for a request with a `wait` parameter the Consul client replaces the read timeout by the wait time plus `wait/16` plus 2 seconds (`TimeoutInterceptor`, enabled by default), so `readTimeout` never applied to them. A short note is added to the 4.23 upgrade guide (`=== camel-consul`, no such heading existed in the 4.22 to 4.23 section; placed before `=== camel-couchbase` rather than at the end of the component entries, where other open PRs insert). Tests: - `ConsulClientConfigurationTimeoutTest` (new): a local `ServerSocket` that accepts connections but never reads or answers; with a 200 ms `readTimeout` a key/value GET, and with a 200 ms `writeTimeout` a PUT of a 32 MB value, must fail with a `SocketTimeoutException` well before the default 10 seconds (bounded with `assertTimeoutPreemptively` at 5 seconds). - Without the change both fail: `execution timed out after 5000 ms`. - With the change all camel-consul unit tests pass: 6 tests, 0 failures (the ITs need Docker). # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built and tested the affected module, including the formatter and import-sort plugins. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
