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

   # CAMEL-24490: apply the configured timeout to the watsonx.ai service clients
   
   `WatsonxAiConfiguration` declares a `timeout` `@UriParam` (_"Request timeout 
in milliseconds"_), but `WatsonxAiServiceFactory` never applied it. Each of the 
12 `createXxxService()` methods set 
`baseUrl`/`apiKey`/`projectId`/`spaceId`/`modelId`/`verifySsl`/`logRequests`/`logResponses`
 on the SDK builder but omitted `timeout`, so the configured value was silently 
ignored and every watsonx.ai request used the SDK default timeout. Streaming 
operations (`ChatHandler`, `TextGenerationHandler`) that block on the returned 
`CompletableFuture` were likewise left effectively unbounded.
   
   ## Fix
   
   The SDK builder base (`com.ibm.watsonx.ai` `WatsonxService.Builder`, 
verified in `watsonx-ai` 0.30.1) exposes `timeout(java.time.Duration)`. Apply 
the configured timeout to every service builder:
   
   ```java
   applyIfNotNull(config.getTimeout(), t -> 
builder.timeout(Duration.ofMillis(t)));
   ```
   
   The SDK then governs how the timeout applies to both unary and streaming 
requests (via its HTTP client), so a configured timeout now bounds the 
previously-unbounded streaming `future.get()` as well.
   
   ## Testing
   
   The module ships only integration tests (they require live watsonx.ai 
credentials); this is a client-configuration fix. Verified with a module build 
(`BUILD SUCCESS`, no generated-file drift — the `timeout` option already 
existed, so no catalog/metadata change).
   
   ---
   _Claude Code on behalf of oscerd_
   


-- 
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