[
https://issues.apache.org/jira/browse/CAMEL-24490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18108732#comment-18108732
]
Andrea Cosentino commented on CAMEL-24490:
------------------------------------------
Merged to main and backported to camel-4.22.x (#25782) and camel-4.18.x
(#25783). Resolving; fixVersions 4.18.5 / 4.22.1 / 4.23.0.
_Claude Code on behalf of oscerd_
> camel-ibm-watsonx-ai: the timeout option is never applied to the watsonx.ai
> service clients
> -------------------------------------------------------------------------------------------
>
> Key: CAMEL-24490
> URL: https://issues.apache.org/jira/browse/CAMEL-24490
> Project: Camel
> Issue Type: Bug
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.22.1, 4.23.0, 4.18.5
>
>
> WatsonxAiConfiguration declares a timeout @UriParam ("Request timeout in
> milliseconds", Long), but WatsonxAiServiceFactory never applies it. Each of
> the 12 createXxxService() methods sets
> baseUrl/apiKey/projectId/spaceId/modelId/verifySsl/logRequests/logResponses
> on the SDK builder but omits timeout:
> {code:java}
> applyIfNotNull(config.getVerifySsl(), builder::verifySsl);
> applyIfTrue(config.getLogRequests(), () -> builder.logRequests(true));
> applyIfTrue(config.getLogResponses(), () -> builder.logResponses(true));
> // timeout never applied
> {code}
> The SDK builder base (com.ibm.watsonx.ai WatsonxService.Builder, verified in
> watsonx-ai 0.30.1) exposes timeout(java.time.Duration), so the configured
> value is silently ignored and every watsonx.ai request uses the SDK default
> timeout. This also leaves streaming operations (ChatHandler /
> TextGenerationHandler, which block on the returned CompletableFuture)
> effectively unbounded, since nothing constrains the underlying HTTP request
> time.
> Fix: apply the configured timeout to every service builder via
> applyIfNotNull(config.getTimeout(), t ->
> builder.timeout(Duration.ofMillis(t))). The SDK then governs how the timeout
> applies to both unary and streaming requests.
> Affected: components/camel-ibm/camel-ibm-watsonx-ai
> (org.apache.camel.component.ibm.watsonx.ai.service.WatsonxAiServiceFactory).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)