oscerd opened a new pull request, #26589:
URL: https://github.com/apache/camel/pull/26589

   ## What
   
   Two divergences in `OpensearchProducer.createClient()` versus the 
`camel-elasticsearch` producer, both affecting real deployments.
   
   ### 1. `socketTimeout` ignored without SSL
   The request-config callback set only `setConnectTimeout(...)`. The 
`socketTimeout` option was applied **only** inside the `if 
(configuration.isEnableSSL())` branch (through the pooling connection manager's 
`ConnectionConfig`). So on a plain-HTTP OpenSearch endpoint the configured 
`socketTimeout` had no effect and a slow/stalled node could block the calling 
thread indefinitely. `camel-elasticsearch` applies both connect and socket 
timeouts unconditionally.
   
   ### 2. Basic-auth scoped to the first host only
   Credentials were registered with `new AuthScope(hostAddressesList.get(0))`, 
binding them to the first configured host/port. In a multi-host cluster, 
requests routed to any other node carried no credentials and were rejected with 
**HTTP 401**. `camel-elasticsearch` uses `AuthScope.ANY` (match all).
   
   ## Fix
   
   - Add `setResponseTimeout(...)` to the request-config callback so the read 
timeout is honoured for both plain-HTTP and SSL connections (HttpClient 5 
equivalent of the socket timeout).
   - Register the credentials with a match-all `AuthScope(null, null, -1, null, 
null)` (the HttpClient 5 idiom, since `AuthScope.ANY` was removed) so basic 
auth reaches every node.
   
   ## Testing
   
   No new unit test: `createClient()` configures the low-level `RestClient`'s 
callbacks, and the resulting credential/timeout config is not observable 
without a live multi-host / authenticated cluster (integration-only). The 
change makes `camel-opensearch` match the behaviour already implemented in 
`camel-elasticsearch`, and is exercised by the existing OpenSearch integration 
tests. Verified the module compiles and its unit tests pass.
   
   ## Notes
   
   - Logic-only; no public API / `@UriParam` / generated-catalog change.
   - Backport candidate for `camel-4.22.x` and `camel-4.18.x`.
   
   _Generated by Claude Code on behalf of Andrea Cosentino (@oscerd)._
   
   🤖 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]

Reply via email to