CAMEL-24476/24477/24478: muteException for the mina, cxf and grpc consumers, backport to camel-4.22.x - #25934
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 36 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) 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) The main commit also carried an unrelated YAML DSL schema regeneration that drops csimple; that hunk is left out, csimple is still valid on this branch. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 20 tested, 25 compile-only — current: 16 all testedMaveniverse Scalpel detected 45 affected modules (current approach: 16).
|
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>
gnodet
left a comment
There was a problem hiding this comment.
Clean backport of muteException consumer options (CAMEL-24476/24477/24478) from main to camel-4.22.x. Implementation code matches the main branch commits character-for-character; deviations are reasonable and documented.
Highlights:
- All three component implementations (CxfConsumer, GrpcMethodHandler, MinaConsumer) and their configuration classes match the main branch commits exactly.
- The CXF implementation correctly separates route failures from deliberate faults and exempts
@WebFault-annotated exceptions from muting — preserving SOAP contract compliance while protecting against information leakage. - All existing tests that assert on exception details have been correctly adapted with
muteException=false. Theassertj-coredependency was correctly added tocamel-cxf-soapfor the new test. - Generated code (catalog JSON, endpoint configurers, URI factories, DSL builders) is updated consistently.
csimpleschema and upgrade guide entries correctly excluded.
📋 PR Metadata
| Aspect | Current | Suggested |
|---|---|---|
| Milestone | (none) | 4.22.1 |
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
…sumers, backport to camel-4.18.x Backports three consumer fixes already reviewed and merged on main to camel-4.18.x (the same set backported to camel-4.22.x in #25934). Each adds a muteException consumer option, defaulting to true, so a route failure no longer hands the remote caller the exception class, message or stack trace: mina consumers stop echoing exceptions back over the socket, cxf/SOAP faults for undeclared exceptions no longer describe internal types and messages (declared @webfault faults are unaffected), and grpc no longer puts the route exception's message into the status description. This aligns all three with the behaviour CAMEL-23651 established for the HTTP consumers. This branch has diverged from main in the test layer and in CxfConsumer, so three commits needed manual conflict resolution rather than a mechanical cherry-pick: MinaMuteExceptionTest uses JUnit assertions to match this branch's existing style, CxfConsumer keeps its instanceof-and-cast Fault check instead of main's pattern-matching form, and GrpcConsumerExceptionTest keeps this branch's AvailablePortFinder-based port binding since GrpcTestSupport doesn't exist here. An unrelated YAML DSL schema regeneration hunk was left out of the grpc commit. Catalog and DSL mirrors were regenerated from this branch's module descriptors. Also includes a GreeterClientTest update for the new cxf muteException default. Upgrade-guide entries are intentionally excluded — those live on main only. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Closes #25935
Backport to
camel-4.22.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)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, both mechanical:
MinaMuteExceptionTestuses JUnit assertions instead of AssertJ.camel-minahas no assertj test dependency on this branch and its other 36 test classes are JUnit, so adding one was the wrong trade for a backport.maincarried an unrelated YAML DSL schema regeneration that removescsimplefrom the expression list. That hunk is left out;csimpleis still valid on this branch.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. Catalog and DSL mirrors regenerated from this branch, so nomain-only metadata leaks in.Claude Code on behalf of oscerd