allthingssecurity opened a new pull request, #27247: URL: https://github.com/apache/camel/pull/27247
# Description [CAMEL-25250](https://issues.apache.org/jira/browse/CAMEL-25250) `GrpcMethodHandler.handle` ends unary and server streaming calls with `Status.INTERNAL` when the exchange failed (CAMEL-14893, description per `muteException` since CAMEL-24478). Client streaming and bidirectional streaming calls are handled by the consumer strategy observers, which never checked the exchange: - `GrpcRequestAggregationStreamObserver.onCompleted` (`AGGREGATION`) sent the message body and completed the call; - `GrpcRequestPropagationStreamObserver.onNext` (`PROPAGATION`) sent the body of each exchange, and `onCompleted` completed the call. A route that failed after building its response therefore answered the client with that response and a normal completion; the error only reached the consumer's exception handler. This change: both observers end the call with the same error as the unary path when the exchange failed (`GrpcMethodHandler.toStatusException`, shared, so `muteException` applies the same way). The propagation observer remembers the failure: the call is over, so the client's later messages are no longer routed and the response observer is not called again (the client's `onCompleted`/`onError` are still forwarded to the route when `forwardOnCompleted`/`forwardOnError` are set). The upgrade note says how to keep a stream open (handle the exception). `DELEGATION` is unchanged (the route owns the response observer). The upgrade guide for 4.23 gets a note. Tests: - `GrpcConsumerStreamingExceptionTest` (new): a client streaming call to an `AGGREGATION` route and to a `PROPAGATION` route that build a `PongResponse` and then throw. - Without the change both fail: the client receives `pong_name: "PINGPONG"` and a normal completion. - With the change all camel-grpc tests pass: 50 tests, 0 failures. # 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 the affected module, 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]
