allthingssecurity opened a new pull request, #27691: URL: https://github.com/apache/camel/pull/27691
# Description [CAMEL-25543](https://issues.apache.org/jira/browse/CAMEL-25543) `DaprClient` returns a Reactor `Mono` for every request, and the request is sent when the `Mono` is subscribed to. `DaprStateHandler` blocks on it for `save`, `get`, `getBulk` and `delete`, but `saveBulkState` and `executeStateTransaction` called `client.saveBulkState(stateRequest)` and `client.executeStateTransaction(stateRequest)` and dropped the `Mono`. So `dapr:state?stateOperation=saveBulk` and `dapr:state?stateOperation=executeTransaction` did nothing: no request reached the sidecar, nothing was stored, and the exchange completed successfully. Now both operations block on the `Mono`, as the other state operations do. The request is sent, and a request that Dapr rejects (or a sidecar that cannot be reached) fails the exchange. The 4.23 upgrade guide has a note next to the existing camel-dapr note. Tests: - Four new tests in `DaprStateTest` (mocked `DaprClient`, as the existing tests): for each of the two operations, a `Mono` that records the states or operations of the request when it is subscribed to, and a `Mono` that fails. - Without the change all four fail: `expected: <[StateKeyValue{key='k1', ...}, StateKeyValue{key='k2', ...}]> but was: <[]>` and `Expected java.lang.IllegalStateException to be thrown, but nothing was thrown.` The existing tests for these operations return `Mono.empty()` and only check the response object. - With the change: camel-dapr 64 tests, 0 failures. - I also checked the real client without a sidecar (not part of the PR): `client.saveBulkState(request)` returns without an error, and `block()` on the same `Mono` fails with `DaprException: UNAVAILABLE`. Found with a search for calls on asynchronous clients whose result is dropped, and a small Lean 4 model of the handler: main leaves the store unchanged and reports success for every request; the fix equals "apply the operations or fail the exchange". # 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 camel-dapr, 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]
