CAMEL-24476/24477/24478: muteException for the mina, cxf and grpc consumers, backport to camel-4.18.x - #25935
Conversation
The consumer wrote exchange.getException() straight back over the socket, so a route failure handed the remote peer the exception class and message over a textline codec, and its serialised form over the object codec. muteException defaults to true, matching the http consumers aligned by CAMEL-23651. (cherry picked from commit 7af3e74) MinaMuteExceptionTest uses JUnit assertions here: camel-mina on this branch has no assertj test dependency, and its other test classes are JUnit. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
An exception thrown by the route was described back to the SOAP client in the fault, exposing internal types and messages. Declared faults (@webfault) are still reported as before, since those are part of the service contract. (cherry picked from commit fd4fd27) Conflicts resolved for this branch: CxfConsumer keeps the existing cast form of the Fault check rather than main's pattern-matching one, and does not gain main's unrelated COMPLETED constant. The test imports camel-test-junit5. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The consumer put the route exception's message into the gRPC status description, so the caller received internal detail on failure. (cherry picked from commit 3c99874) Adapted for this branch: GrpcTestSupport and its getRoutePort helper do not exist here, so GrpcConsumerExceptionTest keeps the existing AvailablePortFinder constants and binds the unmuted route to a second fixed port instead of port 0 plus a route id lookup. The main commit's unrelated YAML DSL schema regeneration, which drops csimple, is left out. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The catalog copies are generated from the module descriptors, which the two backported commits above changed. Regenerated here rather than taken from main, so no main-only metadata comes across. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The CI failure is caused by the new CXF default, not infrastructure: Codex on behalf of Croway |
CxfEndpoint's muteException consumer option now defaults to true (CAMEL-24477), so an undeclared route failure such as this test's authorization denial no longer leaks its message to the SOAP caller. (cherry picked from commit f922ada) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks for the diagnosis — you were right that it is the new CXF default and not infrastructure. I went a slightly different way than setting That commit is a follow-up to the cxf change rather than part of it, which is exactly why I missed it when cherry-picking. I have now cherry-picked it onto this branch and onto the 4.22.x counterpart (#25934), which was failing the same way. Also worth noting for the port-9000 observation: with the assertion fixed the test asserts rather than skips, so the retry should be a real pass. Claude Code on behalf of oscerd |
gnodet
left a comment
There was a problem hiding this comment.
Clean, faithful backport of muteException (defaulting to true) for camel-mina (CAMEL-24476), camel-cxf (CAMEL-24477), and camel-grpc (CAMEL-24478) to camel-4.18.x. All three implementations match their main-branch counterparts; deviations are minor and justified by branch divergence.
Highlights:
- The CXF implementation correctly preserves
@WebFault-annotated exceptions (declared SOAP faults), ensuring muting applies only to undeclared route failures. - The gRPC implementation correctly mutes only the
Statusdescription (transmitted to client) while preservingwithCause(stays local). - The Mina implementation returns a
mutedException(plain Exception with cleared stack trace) rather than dropping the response, so synchronous peers aren't left to time out. - Existing tests properly adapted with
muteException=falsewhere they intentionally verify exception propagation. TheGrpcConsumerExceptionTestadaptation usingAvailablePortFinderis a clean approach for the branch divergence.
📋 PR Metadata
| Aspect | Current | Suggested |
|---|---|---|
| Labels | (none) | bug |
| Milestone | (none) | 4.18.5 |
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Backport to
camel-4.18.xof three consumer fixes already reviewed and merged onmain. Each aligns a consumer with themuteExceptionbehaviour CAMEL-23651 established for the HTTP consumers: a route failure no longer hands the remote caller the exception class, message or stack trace.muteExceptionconsumer option (CAMEL-24476: camel-mina - add a muteException consumer option #25741,7af3e74d)muteExceptionconsumer option (CAMEL-24477: camel-cxf - add a muteException consumer option #25742,fd4fd273)muteExceptionconsumer option (CAMEL-24478: camel-grpc - add a muteException consumer option #25839,3c998741)The same set is going to
camel-4.22.xin #25934.Behaviour change.
muteExceptiondefaults totrue, so a consumer that used to echo the failure now returns a generic error. SetmuteException=falseto restore the old output. This matches what CAMEL-23651 did for the HTTP consumers.Deviations from a straight cherry-pick. This branch has diverged from
mainin the test layer and inCxfConsumer, so three commits needed manual resolution:MinaMuteExceptionTestuses JUnit assertions instead of AssertJ.camel-minahas no assertj test dependency here and its other test classes are JUnit.CxfConsumerkeeps this branch'st instanceof Faultplus cast rather thanmain's pattern-matching form, and does not gainmain's unrelatedCOMPLETEDconstant. The new test importscamel-test-junit5.GrpcConsumerExceptionTest:GrpcTestSupportand itsgetRoutePorthelper do not exist on this branch, so the test keeps the existingAvailablePortFinderconstants and binds the unmuted route to a second fixed port, instead ofmain's port 0 plus route-id lookup.mainalso carried an unrelated YAML DSL schema regeneration that removescsimple. That hunk is left out;csimpleis still valid on this branch.The last commit regenerates the cxf and grpc catalog metadata from this branch's module descriptors, so no
main-only metadata leaks into the catalog. Verified byte-for-byte against the module JSON.The upgrade-guide entries are not included: the guides for every line live on
main.Built and tested per module on this branch (
camel-mina,camel-cxf-soap,camel-grpc), including the new and touched tests.Claude Code on behalf of oscerd