[
https://issues.apache.org/jira/browse/CAMEL-24476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18107856#comment-18107856
]
Andrea Cosentino commented on CAMEL-24476:
------------------------------------------
Fix is implemented and pushed to the fork branch `fix/CAMEL-24476`; the PR is
held until tomorrow because the 10 PR/day limit for this operator is already
reached.
muteException added to MinaConfiguration, defaulting to true. A reply is still
written when muted - suppressing it would set disconnect and leave a
synchronous peer to time out - so the stand-in is a java.lang.Exception with a
fixed message and a cleared stack trace. Clearing the stack trace matters: left
in place, the object codec would serialise this consumer's own frames to the
peer instead.
transferExchange=true is untouched; it serialises the whole Exchange by design
and is already marked security = "insecure:serialization".
Three existing tests assert the exception reaching the peer
(MinaTcpWithInOutUsingPlainSocketTest, MinaTcpWithIoOutProcessorExceptionTest,
MinaTcpLineDelimiterUsingPlainSocketTest). They now set muteException=false -
the same migration an affected deployment performs.
camel-mina 103/103 and a full reactor build (696 modules) are green. camel-mina
did not declare assertj-core; added with test scope.
Backports apply to camel-4.22.x and camel-4.18.x; camel-4.14.x is EOL.
_Claude Code on behalf of oscerd_
> camel-mina - add a muteException consumer option
> ------------------------------------------------
>
> Key: CAMEL-24476
> URL: https://issues.apache.org/jira/browse/CAMEL-24476
> Project: Camel
> Issue Type: Improvement
> Components: camel-mina
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.23.0
>
>
> CAMEL-23651 aligned the {{muteException}} consumer option so that a failed
> exchange does not return the exception's stack trace or message to the remote
> caller. The option exists in camel-http-common (and therefore camel-servlet
> and camel-jetty), camel-http, camel-netty-http, camel-platform-http and
> camel-undertow. A grep for {{muteException}} across {{components/}} still
> shows it in the http family only.
> Split out of CAMEL-24428 so that each component can be tracked, fixed and
> released on its own.
> {{MinaConsumer}} writes the route's exception straight back over the socket
> when the exchange failed and {{transferExchange}} is off:
> {code:java}
> boolean failed = exchange.isFailed();
> if (failed && !getEndpoint().getConfiguration().isTransferExchange()) {
> if (exchange.getException() != null) {
> response = exchange.getException();
> }
> ...
> }
> if (response != null) {
> MinaHelper.writeBody(session, response, exchange,
> configuration.getWriteTimeout());
> }
> {code}
> The remote peer therefore receives the {{Throwable}} - its message, and with
> the object codec its serialised form, including the cause chain.
> Proposal: add a {{muteException}} consumer option, defaulting to {{true}} to
> match the post-CAMEL-23651 behaviour of the http family, with an
> upgrade-guide entry noting that routes relying on the detail must set it to
> {{false}} explicitly.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)