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

   ## Summary
   
   Fix `CamelDaprTimeout` header being silently ignored for 
`waitForInstanceStart` and `waitForInstanceCompletion` workflow operations.
   
   ## Root Cause
   
   `DaprExchangeHeaders.getTimeoutFromHeaders()` was reading 
`DaprConstants.GET_WORKFLOW_IO` (`"CamelDaprGetWorkflowIO"`) instead of 
`DaprConstants.TIMEOUT` (`"CamelDaprTimeout"`). This copy-paste bug caused the 
method to always return `null` (type mismatch: `boolean` header read as 
`Duration`), so `DaprConfigurationOptionsProxy.getTimeout()` always fell back 
to the endpoint configuration, completely ignoring any `CamelDaprTimeout` 
header set on the exchange.
   
   ## Fix
   
   One-line constant fix in `DaprExchangeHeaders.getTimeoutFromHeaders()`:
   
   ```java
   // Before (bug):
   return getObjectFromHeaders(exchange, DaprConstants.GET_WORKFLOW_IO, 
Duration.class);
   
   // After (fix):
   return getObjectFromHeaders(exchange, DaprConstants.TIMEOUT, Duration.class);
   ```
   
   ## Tests
   
   Added two regression tests in `DaprWorkflowTest`:
   - `testWaitForInstanceStartTimeoutFromHeader`: sets `CamelDaprTimeout` 
header with no config timeout, verifies `waitForWorkflowStart` is called with 
the header value
   - `testWaitForInstanceCompletionTimeoutFromHeader`: same for 
`waitForWorkflowCompletion`
   
   Both tests would fail on unfixed code (Mockito `verify` would see `null` 
instead of the header `Duration`) and pass after the fix.
   
   Fixes CAMEL-28014
   
   ---
   _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
   


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