oscerd opened a new pull request, #28222: URL: https://github.com/apache/camel/pull/28222
_Claude Code on behalf of Andrea Cosentino_ [CAMEL-25902](https://issues.apache.org/jira/browse/CAMEL-25902) ## Description When an exchange fails on a synchronous camel-netty consumer and `transferExchange` is off, `ServerChannelHandler.getResponseBody` returns `exchange.getException()` as the reply. With `textline=true` the client receives the class name and message of the route's exception (`NettyTcpWithInOutUsingPlainSocketTest.testExchangeFailedOutShouldBeNull` asserted exactly that); with an encoder that accepts any object, the serialised exception. camel-mina (CAMEL-24476), camel-cxf (CAMEL-24477), camel-grpc (CAMEL-24478), camel-coap (CAMEL-25087) and camel-thrift (CAMEL-25460) have a `muteException` consumer option that defaults to `true`; the plain netty consumer had none. ## Changes - `NettyConfiguration`: new `muteException` consumer option, default `true`. - `ServerChannelHandler.getResponseBody`: when muted, the reply is a `java.lang.Exception` with the message `Exchange processing failed` and a cleared stack trace instead of the route's exception, as `MinaConsumer` does. A reply is still written, so a textline client gets an error line rather than waiting. `transferExchange=true` is unchanged. - camel-netty-http: - `NettyHttpConfiguration` declared `muteException` already (default `true`). It now inherits it from `NettyConfiguration` instead of declaring it twice, with the same accessors and default. - With the option on `NettyConfiguration`, the generated netty-http component configurer maps `muteException` to the component's configuration, while `NettyHttpComponent` kept a field of its own that `createEndpoint` copies onto each endpoint. `camel.component.netty-http.mute-exception=false` would then no longer have been applied. `NettyHttpComponent.isMuteException()`/`setMuteException()` now read and write the configuration, so there is a single option. The public methods are unchanged. - Docs: a paragraph in the Netty Consumer section of `netty-component.adoc`, and upgrade-guide notes in `4_24`, `4_22` (4.22.2 → 4.22.3) and `4_18` (4.18.5 → 4.18.6), all on main as the backport policy requires. The backports will carry no guide edit. ## Tests - New `NettyMuteExceptionTest` (plain sockets, so it checks what reaches the client): with the default, textline over TCP and over UDP replies `java.lang.Exception: Exchange processing failed`; with `muteException=false` the reply is the route's exception as before. - New `NettyHttpComponentMuteExceptionDisabledTest`: `muteException=false` set on the component through its configurer, as `camel.component.netty-http.mute-exception=false` does, reaches the endpoint. - `NettyTcpWithInOutUsingPlainSocketTest` now sets `muteException=false`, the same migration an affected deployment performs. - Both new tests fail without the corresponding production change: the netty one sees the route's exception on the wire, the netty-http one an empty body. - camel-netty: 137 tests, camel-netty-http: 314 tests, all green. The full reactor `install -DskipTests` regenerated only the files included here. Backports to `camel-4.22.x` and `camel-4.18.x` follow once this is merged. 🤖 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]
