[
https://issues.apache.org/jira/browse/CAMEL-25902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18129635#comment-18129635
]
Claus Ibsen commented on CAMEL-25902:
-------------------------------------
Merged on main (4.24.0) by https://github.com/apache/camel/pull/28222. Left
open for the camel-4.22.x and camel-4.18.x backports.
_Claude Code on behalf of Claus Ibsen_
> camel-netty - add a muteException consumer option
> -------------------------------------------------
>
> Key: CAMEL-25902
> URL: https://issues.apache.org/jira/browse/CAMEL-25902
> Project: Camel
> Issue Type: Improvement
> Components: camel-netty
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.18.6, 4.22.3, 4.24.0
>
>
> CAMEL-24476, CAMEL-24477, CAMEL-24478, CAMEL-25087 and CAMEL-25460 added a
> {{muteException}} consumer option to camel-mina, camel-cxf, camel-grpc,
> camel-coap and camel-thrift, defaulting to {{true}} in line with the http
> family after CAMEL-23651. The plain camel-netty consumer (TCP/UDP) has no
> such option.
> When the exchange failed and {{transferExchange}} is off,
> {{ServerChannelHandler.getResponseBody}} uses the route's exception as the
> reply:
> {code:java}
> boolean exception = exchange.getException() != null &&
> !consumer.getEndpoint().getConfiguration().isTransferExchange();
> if (exception) {
> return exchange.getException();
> }
> {code}
> With {{textline=true}} the reply is the exception converted to a String, i.e.
> its class name and message
> ({{NettyTcpWithInOutUsingPlainSocketTest.testExchangeFailedOutShouldBeNull}}
> asserts this). With an encoder that accepts any object, it is the serialised
> exception.
> Proposal: add a {{muteException}} consumer option to {{NettyConfiguration}},
> defaulting to {{true}}, that replies with a generic exception carrying no
> class name, message or stack trace (as camel-mina does), with an
> upgrade-guide entry noting that routes relying on the detail must set it to
> {{false}}. {{NettyHttpConfiguration}} already declares {{muteException}};
> move it up to {{NettyConfiguration}} rather than declaring it twice.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)