You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by kl...@apache.org on 2022/05/11 20:15:08 UTC

[camel] 01/01: CAMEL-18002 Prevent a reused Exchange with non-null UoW from causing loss of onCompletion which is added in DefaultNettyHttpBinding.toCamelMessage(). This onCompletion releases the ByteBuf in the FullHttpRequest.

This is an automated email from the ASF dual-hosted git repository.

klease pushed a commit to branch CAMEL-18002
in repository https://gitbox.apache.org/repos/asf/camel.git

commit f3cd1ba579e03b7ef9b72345dc0b2b4c21955cc4
Author: klease <kl...@cegetel.net>
AuthorDate: Wed May 11 22:07:07 2022 +0200

    CAMEL-18002
    Prevent a reused Exchange with non-null UoW from causing loss of onCompletion
    which is added in DefaultNettyHttpBinding.toCamelMessage().
    This onCompletion releases the ByteBuf in the FullHttpRequest.
---
 .../camel/component/netty/http/handlers/HttpServerChannelHandler.java  | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
index 4b36183f539..2edd5cac98b 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java
@@ -37,6 +37,7 @@ import io.netty.handler.codec.http.HttpResponse;
 import io.netty.handler.codec.http.HttpUtil;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePropertyKey;
+import org.apache.camel.ExtendedExchange;
 import org.apache.camel.LoggingLevel;
 import org.apache.camel.Message;
 import org.apache.camel.component.netty.NettyConverter;
@@ -345,6 +346,8 @@ public class HttpServerChannelHandler extends ServerChannelHandler {
     protected Exchange createExchange(ChannelHandlerContext ctx, Object message) throws Exception {
         Exchange exchange = this.consumer.createExchange(false);
 
+        exchange.adapt(ExtendedExchange.class).setUnitOfWork(null);
+
         // create a new IN message as we cannot reuse with netty
         Message in;
         if (message instanceof FullHttpRequest) {