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

gnodet pushed a commit to branch backport/28991-to-camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 22953302341f0eb273f823129bcec6bd575e6931
Author: Guillaume Nodet <[email protected]>
AuthorDate: Tue Nov 3 08:45:52 2026 +0000

    [backport camel-4.18.x] CAMEL-26508: camel-netty - with transferExchange 
the consumer keeps its own connection headers
---
 .../camel/catalog/components/netty-http.json       |   8 +-
 .../org/apache/camel/catalog/components/netty.json |   8 +-
 .../camel/component/netty/http/netty-http.json     |   8 +-
 .../org/apache/camel/component/netty/netty.json    |   8 +-
 .../camel/component/netty/NettyConfiguration.java  |  11 +-
 .../camel/component/netty/NettyPayloadHelper.java  |  99 ++++++++++++-
 ...NettyTransferExchangeConnectionHeadersTest.java | 157 +++++++++++++++++++++
 .../dsl/NettyComponentBuilderFactory.java          |   8 +-
 .../dsl/NettyHttpComponentBuilderFactory.java      |   8 +-
 .../endpoint/dsl/NettyEndpointBuilderFactory.java  |  48 ++++++-
 .../dsl/NettyHttpEndpointBuilderFactory.java       |  48 ++++++-
 11 files changed, 372 insertions(+), 39 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json
index f1bdeb146707..1a5a03929506 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json
@@ -66,7 +66,7 @@
     "producerPoolMinIdle": { "index": 38, "kind": "property", "displayName": 
"Producer Pool Min Idle", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Sets the minimum number of instances allowed 
in the producer pool before the evi [...]
     "udpConnectionlessSending": { "index": 39, "kind": "property", 
"displayName": "Udp Connectionless Sending", "group": "producer (advanced)", 
"label": "producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "This option supports connection less udp sen 
[...]
     "useByteBuf": { "index": 40, "kind": "property", "displayName": "Use Byte 
Buf", "group": "producer (advanced)", "label": "producer,advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "If the useByteBuf is 
true, netty producer will turn the message body int [...]
-    "allowSerializedHeaders": { "index": 41, "kind": "property", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transferExchange is 
true. When set to true, s [...]
+    "allowSerializedHeaders": { "index": 41, "kind": "property", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:serialization", "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transfe [...]
     "autowiredEnabled": { "index": 42, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching  [...]
     "channelGroup": { "index": 43, "kind": "property", "displayName": "Channel 
Group", "group": "advanced", "label": "advanced", "required": false, "type": 
"object", "javaType": "io.netty.channel.group.ChannelGroup", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "To use an explicit ChannelGroup." },
     "headerFilterStrategy": { "index": 44, "kind": "property", "displayName": 
"Header Filter Strategy", "group": "advanced", "label": "advanced", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": 
false, "secret": false, "description": "To use a custom 
org.apache.camel.spi.HeaderFilterStrategy to filter headers." },
@@ -77,7 +77,7 @@
     "receiveBufferSizePredictor": { "index": 49, "kind": "property", 
"displayName": "Receive Buffer Size Predictor", "group": "advanced", "label": 
"advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Configures the buffer size predictor. See 
details at Jetty documentation and this mail [...]
     "sendBufferSize": { "index": 50, "kind": "property", "displayName": "Send 
Buffer Size", "group": "advanced", "label": "advanced", "required": false, 
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 65536, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "The TCP\/UDP buffer sizes to be used during 
outbound communication. Size is bytes." },
     "shutdownTimeout": { "index": 51, "kind": "property", "displayName": 
"Shutdown Timeout", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 100, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Shutdown await timeout in milliseconds" },
-    "transferExchange": { "index": 52, "kind": "property", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP. You 
can transfer the exchange over the wire instead of just th [...]
+    "transferExchange": { "index": 52, "kind": "property", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "security": "insecure:serialization", 
"description": "Only used for TCP. You can transfer the exc [...]
     "udpByteArrayCodec": { "index": 53, "kind": "property", "displayName": 
"Udp Byte Array Codec", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "For UDP only. If enabled 
the using byte array codec instead of Java serializa [...]
     "unixDomainSocketPath": { "index": 54, "kind": "property", "displayName": 
"Unix Domain Socket Path", "group": "advanced", "label": "advanced", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Path to unix domain socket to use instead of 
inet socket. Host and port parameters wil [...]
     "workerCount": { "index": 55, "kind": "property", "displayName": "Worker 
Count", "group": "advanced", "label": "advanced", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "When netty works on nio mode, it uses default 
workerCount parameter from Netty (which is cpu_core_threads x 2). User c [...]
@@ -186,7 +186,7 @@
     "producerPoolMinEvictableIdle": { "index": 51, "kind": "parameter", 
"displayName": "Producer Pool Min Evictable Idle", "group": "producer 
(advanced)", "label": "producer,advanced", "required": false, "type": 
"integer", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 300000, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Sets the minimum amount 
of [...]
     "producerPoolMinIdle": { "index": 52, "kind": "parameter", "displayName": 
"Producer Pool Min Idle", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Sets the minimum number 
of instances allowed in the producer pool befo [...]
     "useRelativePath": { "index": 53, "kind": "parameter", "displayName": "Use 
Relative Path", "group": "producer (advanced)", "label": "producer,advanced", 
"required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": true, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Sets whether to use a 
relative path in HTTP requests." },
-    "allowSerializedHeaders": { "index": 54, "kind": "parameter", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP when 
transferExchange is true. When set  [...]
+    "allowSerializedHeaders": { "index": 54, "kind": "parameter", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:serialization", "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP wh 
[...]
     "channelGroup": { "index": 55, "kind": "parameter", "displayName": 
"Channel Group", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": "io.netty.channel.group.ChannelGroup", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "To use an explicit 
ChannelGroup." },
     "configuration": { "index": 56, "kind": "parameter", "displayName": 
"Configuration", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", "deprecated": 
false, "autowired": false, "secret": false, "description": "To use a custom 
configured NettyHttpConfiguration for configuring this endpoint." },
     "disableStreamCache": { "index": 57, "kind": "parameter", "displayName": 
"Disable Stream Cache", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Determines whether or 
not the raw input stream from Netty HttpRequ [...]
@@ -200,7 +200,7 @@
     "shutdownTimeout": { "index": 65, "kind": "parameter", "displayName": 
"Shutdown Timeout", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 100, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Shutdown await timeout 
in milliseconds" },
     "synchronous": { "index": 66, "kind": "parameter", "displayName": 
"Synchronous", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Sets whether synchronous 
processing should be strictly used" },
     "transferException": { "index": 67, "kind": "parameter", "displayName": 
"Transfer Exception", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "If enabled and an 
Exchange failed processing on the consumer side, an [...]
-    "transferExchange": { "index": 68, "kind": "parameter", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP. You 
can transfer the exchange over the wire instead  [...]
+    "transferExchange": { "index": 68, "kind": "parameter", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "security": "insecure:serialization", 
"description": "Only used for TCP. You can transf [...]
     "unixDomainSocketPath": { "index": 69, "kind": "parameter", "displayName": 
"Unix Domain Socket Path", "group": "advanced", "label": "advanced", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Path to unix domain 
socket to use instead of inet socket. Host and port para [...]
     "workerCount": { "index": 70, "kind": "parameter", "displayName": "Worker 
Count", "group": "advanced", "label": "advanced", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "When netty works on nio 
mode, it uses default workerCount parameter from Netty (which is 
cpu_core_threads x  [...]
     "workerGroup": { "index": 71, "kind": "parameter", "displayName": "Worker 
Group", "group": "advanced", "label": "advanced", "required": false, "type": 
"object", "javaType": "io.netty.channel.EventLoopGroup", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "To use a explicit 
EventLoopGroup as the boss thread pool. For example to share a  [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty.json
index 1b1f96e40b0d..5b7c76bc0686 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty.json
@@ -64,7 +64,7 @@
     "producerPoolMinIdle": { "index": 37, "kind": "property", "displayName": 
"Producer Pool Min Idle", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Sets the minimum number of instances allowed 
in the producer pool before the evi [...]
     "udpConnectionlessSending": { "index": 38, "kind": "property", 
"displayName": "Udp Connectionless Sending", "group": "producer (advanced)", 
"label": "producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "This option supports connection less udp sen 
[...]
     "useByteBuf": { "index": 39, "kind": "property", "displayName": "Use Byte 
Buf", "group": "producer (advanced)", "label": "producer,advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "If the useByteBuf is 
true, netty producer will turn the message body int [...]
-    "allowSerializedHeaders": { "index": 40, "kind": "property", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transferExchange is 
true. When set to true, s [...]
+    "allowSerializedHeaders": { "index": 40, "kind": "property", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:serialization", "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transfe [...]
     "autowiredEnabled": { "index": 41, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching  [...]
     "channelGroup": { "index": 42, "kind": "property", "displayName": "Channel 
Group", "group": "advanced", "label": "advanced", "required": false, "type": 
"object", "javaType": "io.netty.channel.group.ChannelGroup", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "To use an explicit ChannelGroup." },
     "nativeTransport": { "index": 43, "kind": "property", "displayName": 
"Native Transport", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Whether to use native 
transport instead of NIO. Native transport takes advantage of [...]
@@ -73,7 +73,7 @@
     "receiveBufferSizePredictor": { "index": 46, "kind": "property", 
"displayName": "Receive Buffer Size Predictor", "group": "advanced", "label": 
"advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Configures the buffer size predictor. See 
details at Jetty documentation and this mail [...]
     "sendBufferSize": { "index": 47, "kind": "property", "displayName": "Send 
Buffer Size", "group": "advanced", "label": "advanced", "required": false, 
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 65536, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "The TCP\/UDP buffer sizes to be used during 
outbound communication. Size is bytes." },
     "shutdownTimeout": { "index": 48, "kind": "property", "displayName": 
"Shutdown Timeout", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 100, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Shutdown await timeout in milliseconds" },
-    "transferExchange": { "index": 49, "kind": "property", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP. You 
can transfer the exchange over the wire instead of just th [...]
+    "transferExchange": { "index": 49, "kind": "property", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "security": "insecure:serialization", 
"description": "Only used for TCP. You can transfer the exc [...]
     "udpByteArrayCodec": { "index": 50, "kind": "property", "displayName": 
"Udp Byte Array Codec", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "For UDP only. If enabled 
the using byte array codec instead of Java serializa [...]
     "unixDomainSocketPath": { "index": 51, "kind": "property", "displayName": 
"Unix Domain Socket Path", "group": "advanced", "label": "advanced", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Path to unix domain socket to use instead of 
inet socket. Host and port parameters wil [...]
     "workerCount": { "index": 52, "kind": "property", "displayName": "Worker 
Count", "group": "advanced", "label": "advanced", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "When netty works on nio mode, it uses default 
workerCount parameter from Netty (which is cpu_core_threads x 2). User c [...]
@@ -157,7 +157,7 @@
     "producerPoolMinIdle": { "index": 39, "kind": "parameter", "displayName": 
"Producer Pool Min Idle", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Sets the minimum number of instances allowed 
in the producer pool before the ev [...]
     "udpConnectionlessSending": { "index": 40, "kind": "parameter", 
"displayName": "Udp Connectionless Sending", "group": "producer (advanced)", 
"label": "producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "This option supports connection less udp se 
[...]
     "useByteBuf": { "index": 41, "kind": "parameter", "displayName": "Use Byte 
Buf", "group": "producer (advanced)", "label": "producer,advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "If the useByteBuf is 
true, netty producer will turn the message body in [...]
-    "allowSerializedHeaders": { "index": 42, "kind": "parameter", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transferExchange is 
true. When set to true,  [...]
+    "allowSerializedHeaders": { "index": 42, "kind": "parameter", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:serialization", "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transf [...]
     "channelGroup": { "index": 43, "kind": "parameter", "displayName": 
"Channel Group", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": "io.netty.channel.group.ChannelGroup", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "To use an explicit ChannelGroup." },
     "nativeTransport": { "index": 44, "kind": "parameter", "displayName": 
"Native Transport", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Whether to use native 
transport instead of NIO. Native transport takes advantage o [...]
     "options": { "index": 45, "kind": "parameter", "displayName": "Options", 
"group": "advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": 
"option.", "multiValue": true, "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Allows to configure additional netty opt [...]
@@ -166,7 +166,7 @@
     "sendBufferSize": { "index": 48, "kind": "parameter", "displayName": "Send 
Buffer Size", "group": "advanced", "label": "advanced", "required": false, 
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 65536, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "The TCP\/UDP buffer sizes to be used during 
outbound communication. Size is bytes." },
     "shutdownTimeout": { "index": 49, "kind": "parameter", "displayName": 
"Shutdown Timeout", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 100, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Shutdown await timeout in milliseconds" },
     "synchronous": { "index": 50, "kind": "parameter", "displayName": 
"Synchronous", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "description": "Sets whether 
synchronous processing should be strictly used" },
-    "transferExchange": { "index": 51, "kind": "parameter", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP. You 
can transfer the exchange over the wire instead of just t [...]
+    "transferExchange": { "index": 51, "kind": "parameter", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "security": "insecure:serialization", 
"description": "Only used for TCP. You can transfer the ex [...]
     "udpByteArrayCodec": { "index": 52, "kind": "parameter", "displayName": 
"Udp Byte Array Codec", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "For UDP only. If enabled 
the using byte array codec instead of Java serializ [...]
     "unixDomainSocketPath": { "index": 53, "kind": "parameter", "displayName": 
"Unix Domain Socket Path", "group": "advanced", "label": "advanced", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Path to unix domain socket to use instead of 
inet socket. Host and port parameters wi [...]
     "workerCount": { "index": 54, "kind": "parameter", "displayName": "Worker 
Count", "group": "advanced", "label": "advanced", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "When netty works on nio mode, it uses default 
workerCount parameter from Netty (which is cpu_core_threads x 2). User  [...]
diff --git 
a/components/camel-netty-http/src/generated/resources/META-INF/org/apache/camel/component/netty/http/netty-http.json
 
b/components/camel-netty-http/src/generated/resources/META-INF/org/apache/camel/component/netty/http/netty-http.json
index f1bdeb146707..1a5a03929506 100644
--- 
a/components/camel-netty-http/src/generated/resources/META-INF/org/apache/camel/component/netty/http/netty-http.json
+++ 
b/components/camel-netty-http/src/generated/resources/META-INF/org/apache/camel/component/netty/http/netty-http.json
@@ -66,7 +66,7 @@
     "producerPoolMinIdle": { "index": 38, "kind": "property", "displayName": 
"Producer Pool Min Idle", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Sets the minimum number of instances allowed 
in the producer pool before the evi [...]
     "udpConnectionlessSending": { "index": 39, "kind": "property", 
"displayName": "Udp Connectionless Sending", "group": "producer (advanced)", 
"label": "producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "This option supports connection less udp sen 
[...]
     "useByteBuf": { "index": 40, "kind": "property", "displayName": "Use Byte 
Buf", "group": "producer (advanced)", "label": "producer,advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "If the useByteBuf is 
true, netty producer will turn the message body int [...]
-    "allowSerializedHeaders": { "index": 41, "kind": "property", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transferExchange is 
true. When set to true, s [...]
+    "allowSerializedHeaders": { "index": 41, "kind": "property", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:serialization", "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transfe [...]
     "autowiredEnabled": { "index": 42, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching  [...]
     "channelGroup": { "index": 43, "kind": "property", "displayName": "Channel 
Group", "group": "advanced", "label": "advanced", "required": false, "type": 
"object", "javaType": "io.netty.channel.group.ChannelGroup", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "To use an explicit ChannelGroup." },
     "headerFilterStrategy": { "index": 44, "kind": "property", "displayName": 
"Header Filter Strategy", "group": "advanced", "label": "advanced", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": 
false, "secret": false, "description": "To use a custom 
org.apache.camel.spi.HeaderFilterStrategy to filter headers." },
@@ -77,7 +77,7 @@
     "receiveBufferSizePredictor": { "index": 49, "kind": "property", 
"displayName": "Receive Buffer Size Predictor", "group": "advanced", "label": 
"advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Configures the buffer size predictor. See 
details at Jetty documentation and this mail [...]
     "sendBufferSize": { "index": 50, "kind": "property", "displayName": "Send 
Buffer Size", "group": "advanced", "label": "advanced", "required": false, 
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 65536, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "The TCP\/UDP buffer sizes to be used during 
outbound communication. Size is bytes." },
     "shutdownTimeout": { "index": 51, "kind": "property", "displayName": 
"Shutdown Timeout", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 100, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Shutdown await timeout in milliseconds" },
-    "transferExchange": { "index": 52, "kind": "property", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP. You 
can transfer the exchange over the wire instead of just th [...]
+    "transferExchange": { "index": 52, "kind": "property", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "security": "insecure:serialization", 
"description": "Only used for TCP. You can transfer the exc [...]
     "udpByteArrayCodec": { "index": 53, "kind": "property", "displayName": 
"Udp Byte Array Codec", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "For UDP only. If enabled 
the using byte array codec instead of Java serializa [...]
     "unixDomainSocketPath": { "index": 54, "kind": "property", "displayName": 
"Unix Domain Socket Path", "group": "advanced", "label": "advanced", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Path to unix domain socket to use instead of 
inet socket. Host and port parameters wil [...]
     "workerCount": { "index": 55, "kind": "property", "displayName": "Worker 
Count", "group": "advanced", "label": "advanced", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "When netty works on nio mode, it uses default 
workerCount parameter from Netty (which is cpu_core_threads x 2). User c [...]
@@ -186,7 +186,7 @@
     "producerPoolMinEvictableIdle": { "index": 51, "kind": "parameter", 
"displayName": "Producer Pool Min Evictable Idle", "group": "producer 
(advanced)", "label": "producer,advanced", "required": false, "type": 
"integer", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 300000, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Sets the minimum amount 
of [...]
     "producerPoolMinIdle": { "index": 52, "kind": "parameter", "displayName": 
"Producer Pool Min Idle", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Sets the minimum number 
of instances allowed in the producer pool befo [...]
     "useRelativePath": { "index": 53, "kind": "parameter", "displayName": "Use 
Relative Path", "group": "producer (advanced)", "label": "producer,advanced", 
"required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": true, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Sets whether to use a 
relative path in HTTP requests." },
-    "allowSerializedHeaders": { "index": 54, "kind": "parameter", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP when 
transferExchange is true. When set  [...]
+    "allowSerializedHeaders": { "index": 54, "kind": "parameter", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:serialization", "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP wh 
[...]
     "channelGroup": { "index": 55, "kind": "parameter", "displayName": 
"Channel Group", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": "io.netty.channel.group.ChannelGroup", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "To use an explicit 
ChannelGroup." },
     "configuration": { "index": 56, "kind": "parameter", "displayName": 
"Configuration", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", "deprecated": 
false, "autowired": false, "secret": false, "description": "To use a custom 
configured NettyHttpConfiguration for configuring this endpoint." },
     "disableStreamCache": { "index": 57, "kind": "parameter", "displayName": 
"Disable Stream Cache", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Determines whether or 
not the raw input stream from Netty HttpRequ [...]
@@ -200,7 +200,7 @@
     "shutdownTimeout": { "index": 65, "kind": "parameter", "displayName": 
"Shutdown Timeout", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 100, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Shutdown await timeout 
in milliseconds" },
     "synchronous": { "index": 66, "kind": "parameter", "displayName": 
"Synchronous", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Sets whether synchronous 
processing should be strictly used" },
     "transferException": { "index": 67, "kind": "parameter", "displayName": 
"Transfer Exception", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "If enabled and an 
Exchange failed processing on the consumer side, an [...]
-    "transferExchange": { "index": 68, "kind": "parameter", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP. You 
can transfer the exchange over the wire instead  [...]
+    "transferExchange": { "index": 68, "kind": "parameter", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "security": "insecure:serialization", 
"description": "Only used for TCP. You can transf [...]
     "unixDomainSocketPath": { "index": 69, "kind": "parameter", "displayName": 
"Unix Domain Socket Path", "group": "advanced", "label": "advanced", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "Path to unix domain 
socket to use instead of inet socket. Host and port para [...]
     "workerCount": { "index": 70, "kind": "parameter", "displayName": "Worker 
Count", "group": "advanced", "label": "advanced", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "When netty works on nio 
mode, it uses default workerCount parameter from Netty (which is 
cpu_core_threads x  [...]
     "workerGroup": { "index": 71, "kind": "parameter", "displayName": "Worker 
Group", "group": "advanced", "label": "advanced", "required": false, "type": 
"object", "javaType": "io.netty.channel.EventLoopGroup", "deprecated": false, 
"autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.http.NettyHttpConfiguration", 
"configurationField": "configuration", "description": "To use a explicit 
EventLoopGroup as the boss thread pool. For example to share a  [...]
diff --git 
a/components/camel-netty/src/generated/resources/META-INF/org/apache/camel/component/netty/netty.json
 
b/components/camel-netty/src/generated/resources/META-INF/org/apache/camel/component/netty/netty.json
index 1b1f96e40b0d..5b7c76bc0686 100644
--- 
a/components/camel-netty/src/generated/resources/META-INF/org/apache/camel/component/netty/netty.json
+++ 
b/components/camel-netty/src/generated/resources/META-INF/org/apache/camel/component/netty/netty.json
@@ -64,7 +64,7 @@
     "producerPoolMinIdle": { "index": 37, "kind": "property", "displayName": 
"Producer Pool Min Idle", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Sets the minimum number of instances allowed 
in the producer pool before the evi [...]
     "udpConnectionlessSending": { "index": 38, "kind": "property", 
"displayName": "Udp Connectionless Sending", "group": "producer (advanced)", 
"label": "producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "This option supports connection less udp sen 
[...]
     "useByteBuf": { "index": 39, "kind": "property", "displayName": "Use Byte 
Buf", "group": "producer (advanced)", "label": "producer,advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "If the useByteBuf is 
true, netty producer will turn the message body int [...]
-    "allowSerializedHeaders": { "index": 40, "kind": "property", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transferExchange is 
true. When set to true, s [...]
+    "allowSerializedHeaders": { "index": 40, "kind": "property", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:serialization", "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transfe [...]
     "autowiredEnabled": { "index": 41, "kind": "property", "displayName": 
"Autowired Enabled", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": 
"Whether autowiring is enabled. This is used for automatic autowiring options 
(the option must be marked as autowired) by looking up in the registry to find 
if there is a single instance of matching  [...]
     "channelGroup": { "index": 42, "kind": "property", "displayName": "Channel 
Group", "group": "advanced", "label": "advanced", "required": false, "type": 
"object", "javaType": "io.netty.channel.group.ChannelGroup", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "To use an explicit ChannelGroup." },
     "nativeTransport": { "index": 43, "kind": "property", "displayName": 
"Native Transport", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Whether to use native 
transport instead of NIO. Native transport takes advantage of [...]
@@ -73,7 +73,7 @@
     "receiveBufferSizePredictor": { "index": 46, "kind": "property", 
"displayName": "Receive Buffer Size Predictor", "group": "advanced", "label": 
"advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Configures the buffer size predictor. See 
details at Jetty documentation and this mail [...]
     "sendBufferSize": { "index": 47, "kind": "property", "displayName": "Send 
Buffer Size", "group": "advanced", "label": "advanced", "required": false, 
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 65536, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "The TCP\/UDP buffer sizes to be used during 
outbound communication. Size is bytes." },
     "shutdownTimeout": { "index": 48, "kind": "property", "displayName": 
"Shutdown Timeout", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 100, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Shutdown await timeout in milliseconds" },
-    "transferExchange": { "index": 49, "kind": "property", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP. You 
can transfer the exchange over the wire instead of just th [...]
+    "transferExchange": { "index": 49, "kind": "property", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "security": "insecure:serialization", 
"description": "Only used for TCP. You can transfer the exc [...]
     "udpByteArrayCodec": { "index": 50, "kind": "property", "displayName": 
"Udp Byte Array Codec", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "For UDP only. If enabled 
the using byte array codec instead of Java serializa [...]
     "unixDomainSocketPath": { "index": 51, "kind": "property", "displayName": 
"Unix Domain Socket Path", "group": "advanced", "label": "advanced", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Path to unix domain socket to use instead of 
inet socket. Host and port parameters wil [...]
     "workerCount": { "index": 52, "kind": "property", "displayName": "Worker 
Count", "group": "advanced", "label": "advanced", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "When netty works on nio mode, it uses default 
workerCount parameter from Netty (which is cpu_core_threads x 2). User c [...]
@@ -157,7 +157,7 @@
     "producerPoolMinIdle": { "index": 39, "kind": "parameter", "displayName": 
"Producer Pool Min Idle", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "integer", "javaType": "int", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Sets the minimum number of instances allowed 
in the producer pool before the ev [...]
     "udpConnectionlessSending": { "index": 40, "kind": "parameter", 
"displayName": "Udp Connectionless Sending", "group": "producer (advanced)", 
"label": "producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "This option supports connection less udp se 
[...]
     "useByteBuf": { "index": 41, "kind": "parameter", "displayName": "Use Byte 
Buf", "group": "producer (advanced)", "label": "producer,advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "If the useByteBuf is 
true, netty producer will turn the message body in [...]
-    "allowSerializedHeaders": { "index": 42, "kind": "parameter", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transferExchange is 
true. When set to true,  [...]
+    "allowSerializedHeaders": { "index": 42, "kind": "parameter", 
"displayName": "Allow Serialized Headers", "group": "advanced", "label": 
"advanced", "required": false, "type": "boolean", "javaType": "boolean", 
"deprecated": false, "autowired": false, "secret": false, "security": 
"insecure:serialization", "defaultValue": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Only used for TCP when transf [...]
     "channelGroup": { "index": 43, "kind": "parameter", "displayName": 
"Channel Group", "group": "advanced", "label": "advanced", "required": false, 
"type": "object", "javaType": "io.netty.channel.group.ChannelGroup", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "To use an explicit ChannelGroup." },
     "nativeTransport": { "index": 44, "kind": "parameter", "displayName": 
"Native Transport", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Whether to use native 
transport instead of NIO. Native transport takes advantage o [...]
     "options": { "index": 45, "kind": "parameter", "displayName": "Options", 
"group": "advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": 
"option.", "multiValue": true, "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Allows to configure additional netty opt [...]
@@ -166,7 +166,7 @@
     "sendBufferSize": { "index": 48, "kind": "parameter", "displayName": "Send 
Buffer Size", "group": "advanced", "label": "advanced", "required": false, 
"type": "integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 65536, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "The TCP\/UDP buffer sizes to be used during 
outbound communication. Size is bytes." },
     "shutdownTimeout": { "index": 49, "kind": "parameter", "displayName": 
"Shutdown Timeout", "group": "advanced", "label": "advanced", "required": 
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 100, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Shutdown await timeout in milliseconds" },
     "synchronous": { "index": 50, "kind": "parameter", "displayName": 
"Synchronous", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": false, "description": "Sets whether 
synchronous processing should be strictly used" },
-    "transferExchange": { "index": 51, "kind": "parameter", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "Only used for TCP. You 
can transfer the exchange over the wire instead of just t [...]
+    "transferExchange": { "index": 51, "kind": "parameter", "displayName": 
"Transfer Exchange", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "security": "insecure:serialization", 
"description": "Only used for TCP. You can transfer the ex [...]
     "udpByteArrayCodec": { "index": 52, "kind": "parameter", "displayName": 
"Udp Byte Array Codec", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": "org.apache.camel.component.netty.NettyConfiguration", 
"configurationField": "configuration", "description": "For UDP only. If enabled 
the using byte array codec instead of Java serializ [...]
     "unixDomainSocketPath": { "index": 53, "kind": "parameter", "displayName": 
"Unix Domain Socket Path", "group": "advanced", "label": "advanced", 
"required": false, "type": "string", "javaType": "java.lang.String", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "Path to unix domain socket to use instead of 
inet socket. Host and port parameters wi [...]
     "workerCount": { "index": 54, "kind": "parameter", "displayName": "Worker 
Count", "group": "advanced", "label": "advanced", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.netty.NettyConfiguration", "configurationField": 
"configuration", "description": "When netty works on nio mode, it uses default 
workerCount parameter from Netty (which is cpu_core_threads x 2). User  [...]
diff --git 
a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
 
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
index 4cdd8741388f..299bf6675acc 100644
--- 
a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
+++ 
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
@@ -95,7 +95,11 @@ public class NettyConfiguration extends 
NettyServerBootstrapConfiguration implem
               description = "Only used for TCP. You can transfer the exchange 
over the wire instead of just the body. The following fields are"
                             + " transferred: In body, Out body, fault body, In 
headers, Out headers, fault headers, exchange properties, exchange"
                             + " exception. This requires that the objects are 
serializable. Camel will exclude any non-serializable objects and"
-                            + " log it at WARN level.")
+                            + " log it at WARN level. The connection headers 
(CamelNettyRemoteAddress, CamelNettyLocalAddress,"
+                            + " CamelNettyChannelHandlerContext, 
CamelNettySSLSession and the CamelNettySSLClientCert headers) and the"
+                            + " CamelNettyRemoteAddress and CamelNettyChannel 
exchange properties are always the ones of the receiving"
+                            + " side: the connection it accepted is the source 
of truth, and these values are never taken from the"
+                            + " transferred exchange.")
     private boolean transferExchange;
     @UriParam(label = "advanced",
               description = "Only used for TCP when transferExchange is true. 
When set to true, serializable objects in headers and properties"
@@ -566,7 +570,10 @@ public class NettyConfiguration extends 
NettyServerBootstrapConfiguration implem
      * Only used for TCP. You can transfer the exchange over the wire instead 
of just the body. The following fields are
      * transferred: In body, Out body, fault body, In headers, Out headers, 
fault headers, exchange properties, exchange
      * exception. This requires that the objects are serializable. Camel will 
exclude any non-serializable objects and
-     * log it at WARN level.
+     * log it at WARN level. The connection headers (CamelNettyRemoteAddress, 
CamelNettyLocalAddress,
+     * CamelNettyChannelHandlerContext, CamelNettySSLSession and the 
CamelNettySSLClientCert headers) and the
+     * CamelNettyRemoteAddress and CamelNettyChannel exchange properties are 
always the ones of the receiving side: the
+     * connection it accepted is the source of truth, and these values are 
never taken from the transferred exchange.
      */
     public void setTransferExchange(boolean transferExchange) {
         this.transferExchange = transferExchange;
diff --git 
a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java
 
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java
index 1f35f507c30d..f510b8cf4580 100644
--- 
a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java
+++ 
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java
@@ -17,11 +17,14 @@
 package org.apache.camel.component.netty;
 
 import java.net.InetSocketAddress;
+import java.util.HashMap;
+import java.util.Map;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.channel.AddressedEnvelope;
 import org.apache.camel.Exchange;
 import org.apache.camel.support.DefaultExchangeHolder;
+import org.apache.camel.support.ExchangeHelper;
 
 /**
  * Helper to get and set the correct payload when transferring data using 
camel-netty. Always use this helper instead of
@@ -32,6 +35,17 @@ import org.apache.camel.support.DefaultExchangeHolder;
  */
 public final class NettyPayloadHelper {
 
+    /**
+     * The headers and exchange properties holding objects of the Netty 
transport of this side (the channel, the socket
+     * addresses, the SSL session). They are not transferred with 
transferExchange=true: they mean nothing on the other
+     * side, and the decoder of the other side may reject their classes (the 
default deserialization filter of the
+     * camel-netty {@code ObjectDecoder} rejects java.net classes).
+     */
+    private static final String[] TRANSPORT_KEYS = {
+            NettyConstants.NETTY_CHANNEL_HANDLER_CONTEXT, 
NettyConstants.NETTY_MESSAGE_EVENT,
+            NettyConstants.NETTY_REMOTE_ADDRESS, 
NettyConstants.NETTY_LOCAL_ADDRESS, NettyConstants.NETTY_SSL_SESSION,
+            NettyConstants.NETTY_CHANNEL };
+
     private NettyPayloadHelper() {
         //Helper class
     }
@@ -39,7 +53,7 @@ public final class NettyPayloadHelper {
     public static Object getIn(NettyEndpoint endpoint, Exchange exchange) {
         if (endpoint.getConfiguration().isTransferExchange()) {
             // we should transfer the entire exchange over the wire (includes 
in/out)
-            return DefaultExchangeHolder.marshal(exchange, true, 
endpoint.getConfiguration().isAllowSerializedHeaders());
+            return marshal(endpoint, exchange);
         } else {
             if (endpoint.getConfiguration().isUseByteBuf()) {
                 // Just leverage the type converter
@@ -53,23 +67,51 @@ public final class NettyPayloadHelper {
 
     public static Object getOut(NettyEndpoint endpoint, Exchange exchange) {
         if (endpoint.getConfiguration().isTransferExchange()) {
-            // we should transfer the entire exchange over the wire (includes 
in/out)
-            return DefaultExchangeHolder.marshal(exchange);
+            // we should transfer the entire exchange over the wire (includes 
in/out), and as for the request only
+            // include serialized values in headers, properties and variables 
when allowed
+            return marshal(endpoint, exchange);
         } else {
             // normal transfer using the body only
             return exchange.getOut().getBody();
         }
     }
 
+    private static DefaultExchangeHolder marshal(NettyEndpoint endpoint, 
Exchange exchange) {
+        Exchange source = exchange;
+        if (hasTransportValues(exchange)) {
+            // marshal a copy without the Netty transport values, and leave 
the exchange as is
+            source = ExchangeHelper.createCopy(exchange, true);
+            for (String key : TRANSPORT_KEYS) {
+                source.getIn().removeHeader(key);
+                if (source.hasOut()) {
+                    source.getOut().removeHeader(key);
+                }
+                source.removeProperty(key);
+            }
+        }
+        return DefaultExchangeHolder.marshal(source, true, 
endpoint.getConfiguration().isAllowSerializedHeaders());
+    }
+
+    private static boolean hasTransportValues(Exchange exchange) {
+        for (String key : TRANSPORT_KEYS) {
+            if (exchange.getIn().getHeader(key) != null
+                    || exchange.hasOut() && exchange.getOut().getHeader(key) 
!= null
+                    || exchange.getProperty(key) != null) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     public static void setIn(Exchange exchange, Object payload) {
         if (payload instanceof DefaultExchangeHolder) {
-            DefaultExchangeHolder.unmarshal(exchange, (DefaultExchangeHolder) 
payload);
+            unmarshal(exchange, (DefaultExchangeHolder) payload);
         } else if (payload instanceof AddressedEnvelope) {
             @SuppressWarnings("unchecked")
             AddressedEnvelope<Object, InetSocketAddress> dp = 
(AddressedEnvelope<Object, InetSocketAddress>) payload;
             // need to check if the content is ExchangeHolder
             if (dp.content() instanceof DefaultExchangeHolder) {
-                DefaultExchangeHolder.unmarshal(exchange, 
(DefaultExchangeHolder) dp.content());
+                unmarshal(exchange, (DefaultExchangeHolder) dp.content());
             } else {
                 // need to take out the payload here
                 exchange.getIn().setBody(dp.content());
@@ -86,13 +128,13 @@ public final class NettyPayloadHelper {
 
     public static void setOut(Exchange exchange, Object payload) {
         if (payload instanceof DefaultExchangeHolder) {
-            DefaultExchangeHolder.unmarshal(exchange, (DefaultExchangeHolder) 
payload);
+            unmarshal(exchange, (DefaultExchangeHolder) payload);
         } else if (payload instanceof AddressedEnvelope) {
             @SuppressWarnings("unchecked")
             AddressedEnvelope<Object, InetSocketAddress> dp = 
(AddressedEnvelope<Object, InetSocketAddress>) payload;
             // need to check if the content is ExchangeHolder
             if (dp.content() instanceof DefaultExchangeHolder) {
-                DefaultExchangeHolder.unmarshal(exchange, 
(DefaultExchangeHolder) dp.content());
+                unmarshal(exchange, (DefaultExchangeHolder) dp.content());
             } else {
                 // need to take out the payload here
                 exchange.getOut().setBody(dp.content());
@@ -106,4 +148,47 @@ public final class NettyPayloadHelper {
         }
     }
 
+    /**
+     * The headers and exchange properties that describe the Netty connection 
of this side.
+     */
+    private static final String[] CONNECTION_KEYS = {
+            NettyConstants.NETTY_CHANNEL_HANDLER_CONTEXT, 
NettyConstants.NETTY_REMOTE_ADDRESS,
+            NettyConstants.NETTY_LOCAL_ADDRESS, NettyConstants.NETTY_CHANNEL,
+            NettyConstants.NETTY_SSL_SESSION, 
NettyConstants.NETTY_SSL_CLIENT_CERT_SUBJECT_NAME,
+            NettyConstants.NETTY_SSL_CLIENT_CERT_ISSUER_NAME, 
NettyConstants.NETTY_SSL_CLIENT_CERT_SERIAL_NO,
+            NettyConstants.NETTY_SSL_CLIENT_CERT_NOT_BEFORE, 
NettyConstants.NETTY_SSL_CLIENT_CERT_NOT_AFTER };
+
+    /**
+     * Unmarshals the transferred exchange into the exchange, but keeps the 
connection headers and exchange properties
+     * of this side: the connection this side accepted (or opened) is the 
source of truth for them. A connection header
+     * or property in the transferred exchange is never used, also when this 
side has no value for it (for example the
+     * SSL client certificate headers when the connection has no client 
certificate).
+     */
+    private static void unmarshal(Exchange exchange, DefaultExchangeHolder 
holder) {
+        Map<String, Object> headers = new HashMap<>();
+        Map<String, Object> properties = new HashMap<>();
+        for (String key : CONNECTION_KEYS) {
+            Object value = exchange.getIn().getHeader(key);
+            if (value != null) {
+                headers.put(key, value);
+            }
+            value = exchange.getProperty(key);
+            if (value != null) {
+                properties.put(key, value);
+            }
+        }
+
+        DefaultExchangeHolder.unmarshal(exchange, holder);
+
+        for (String key : CONNECTION_KEYS) {
+            exchange.getIn().removeHeader(key);
+            if (exchange.hasOut()) {
+                exchange.getOut().removeHeader(key);
+            }
+            exchange.removeProperty(key);
+        }
+        headers.forEach(exchange.getIn()::setHeader);
+        properties.forEach(exchange::setProperty);
+    }
+
 }
diff --git 
a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyTransferExchangeConnectionHeadersTest.java
 
b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyTransferExchangeConnectionHeadersTest.java
new file mode 100644
index 000000000000..360185c2913f
--- /dev/null
+++ 
b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyTransferExchangeConnectionHeadersTest.java
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.netty;
+
+import java.io.File;
+import java.net.InetSocketAddress;
+
+import io.netty.channel.ChannelHandler;
+import io.netty.handler.codec.serialization.ClassResolvers;
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.netty.codec.ObjectDecoder;
+import org.apache.camel.component.netty.codec.ObjectEncoder;
+import org.apache.camel.test.AvailablePortFinder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+/**
+ * With transferExchange the consumer keeps its own connection headers: the 
connection it accepted is the source of
+ * truth, so the connection headers and properties in the transferred exchange 
are not used.
+ */
+@DisabledIfSystemProperty(named = "java.vendor", matches = ".*ibm.*")
+public class NettyTransferExchangeConnectionHeadersTest extends BaseNettyTest {
+
+    private static final String CLIENT_CERT_SUBJECT
+            = "SERIALNUMBER=1234567890, CN=CommonName, OU=Unit, O=Org, L=Loc, 
ST=State, C=US";
+    private static final String CODECS = 
"&encoders=#encoder&decoders=#decoder";
+    private static final String SSL_OPTIONS = 
"&ssl=true&passphrase=changeit&keyStoreResource=#ksf&trustStoreResource=#tsf";
+
+    @RegisterExtension
+    AvailablePortFinder.Port sslPort = AvailablePortFinder.find();
+
+    @BindToRegistry("ksf")
+    public File loadKeystoreKsf() {
+        return new File("src/test/resources/keystore.jks");
+    }
+
+    @BindToRegistry("tsf")
+    public File loadKeystoreTsf() {
+        return new File("src/test/resources/keystore.jks");
+    }
+
+    @BindToRegistry("encoder")
+    public ChannelHandler getEncoder() {
+        return new ShareableChannelHandlerFactory(new ObjectEncoder());
+    }
+
+    @BindToRegistry("decoder")
+    public ChannelHandler getDecoder() {
+        return new DefaultChannelHandlerFactory() {
+            @Override
+            public ChannelHandler newChannelHandler() {
+                return new 
ObjectDecoder(ClassResolvers.weakCachingResolver(null));
+            }
+        };
+    }
+
+    @Test
+    public void testConsumerKeepsItsConnectionHeaders() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:plain");
+        mock.expectedBodiesReceived("Hello World");
+        mock.expectedHeaderReceived("cheese", "gouda");
+
+        Exchange reply = 
template.request("netty:tcp://localhost:{{port}}?sync=true&transferExchange=true"
 + CODECS, e -> {
+            e.getIn().setBody("Hello World");
+            e.getIn().setHeader("cheese", "gouda");
+            e.getIn().setHeader(NettyConstants.NETTY_REMOTE_ADDRESS, 
"10.1.2.3:4567");
+            e.getIn().setHeader(NettyConstants.NETTY_LOCAL_ADDRESS, 
"10.1.2.3:8910");
+            
e.getIn().setHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_SUBJECT_NAME, 
"CN=Sender");
+            
e.getIn().setHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_SERIAL_NO, "42");
+            e.setProperty(NettyConstants.NETTY_REMOTE_ADDRESS, 
"10.1.2.3:4567");
+        });
+        assertNull(reply.getException());
+
+        MockEndpoint.assertIsSatisfied(context);
+
+        Exchange received = mock.getReceivedExchanges().get(0);
+        Message in = received.getIn();
+        // the addresses of the connection the consumer accepted
+        assertInstanceOf(InetSocketAddress.class, 
in.getHeader(NettyConstants.NETTY_REMOTE_ADDRESS));
+        InetSocketAddress local = assertInstanceOf(InetSocketAddress.class, 
in.getHeader(NettyConstants.NETTY_LOCAL_ADDRESS));
+        assertEquals(getPort(), local.getPort());
+        // no client certificate on this connection, so no client certificate 
headers
+        
assertNull(in.getHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_SUBJECT_NAME));
+        
assertNull(in.getHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_SERIAL_NO));
+        assertNull(received.getProperty(NettyConstants.NETTY_REMOTE_ADDRESS));
+
+        // the producer keeps its own connection headers too: the reply has 
none from the consumer
+        Message message = reply.getMessage();
+        assertEquals("Bye World", message.getBody());
+        assertEquals("cheddar", message.getHeader("cheese"));
+        
assertNull(message.getHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_SUBJECT_NAME));
+        assertNull(message.getHeader(NettyConstants.NETTY_REMOTE_ADDRESS));
+    }
+
+    @Test
+    public void testConsumerKeepsItsClientCertHeaders() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:ssl");
+        mock.expectedBodiesReceived("Hello World");
+        
mock.expectedHeaderReceived(NettyConstants.NETTY_SSL_CLIENT_CERT_SUBJECT_NAME, 
CLIENT_CERT_SUBJECT);
+        
mock.expectedHeaderReceived(NettyConstants.NETTY_SSL_CLIENT_CERT_ISSUER_NAME, 
CLIENT_CERT_SUBJECT);
+        
mock.expectedHeaderReceived(NettyConstants.NETTY_SSL_CLIENT_CERT_SERIAL_NO, 
"1234567890");
+
+        Exchange reply = template.request(
+                "netty:tcp://localhost:" + sslPort.getPort() + 
"?sync=true&transferExchange=true" + CODECS + SSL_OPTIONS, e -> {
+                    e.getIn().setBody("Hello World");
+                    
e.getIn().setHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_SUBJECT_NAME, 
"CN=Sender");
+                    
e.getIn().setHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_ISSUER_NAME, 
"CN=Sender CA");
+                    
e.getIn().setHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_SERIAL_NO, "42");
+                });
+        assertNull(reply.getException());
+        assertEquals("Bye World", reply.getMessage().getBody());
+
+        MockEndpoint.assertIsSatisfied(context);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                
from("netty:tcp://localhost:{{port}}?sync=true&transferExchange=true" + CODECS)
+                        .to("mock:plain")
+                        .setHeader("cheese", constant("cheddar"))
+                        
.setHeader(NettyConstants.NETTY_SSL_CLIENT_CERT_SUBJECT_NAME, 
constant("CN=Consumer"))
+                        .transform().constant("Bye World");
+
+                from("netty:tcp://localhost:" + sslPort.getPort() + 
"?sync=true&transferExchange=true" + CODECS + SSL_OPTIONS
+                     + "&needClientAuth=true&sslClientCertHeaders=true")
+                        .to("mock:ssl")
+                        .transform().constant("Bye World");
+            }
+        };
+    }
+}
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyComponentBuilderFactory.java
index e10919a8a683..8a2ee3d37965 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyComponentBuilderFactory.java
@@ -994,7 +994,13 @@ public interface NettyComponentBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyHttpComponentBuilderFactory.java
 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyHttpComponentBuilderFactory.java
index d8036cb42c42..719419f6e9ef 100644
--- 
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyHttpComponentBuilderFactory.java
+++ 
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/NettyHttpComponentBuilderFactory.java
@@ -1048,7 +1048,13 @@ public interface NettyHttpComponentBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
          * 
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyEndpointBuilderFactory.java
index dca4875e0aeb..58cb3d26145f 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyEndpointBuilderFactory.java
@@ -1653,7 +1653,13 @@ public interface NettyEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -1673,7 +1679,13 @@ public interface NettyEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
@@ -3373,7 +3385,13 @@ public interface NettyEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -3393,7 +3411,13 @@ public interface NettyEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
@@ -4543,7 +4567,13 @@ public interface NettyEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -4563,7 +4593,13 @@ public interface NettyEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyHttpEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyHttpEndpointBuilderFactory.java
index f88757a4fce7..c6744b03a1a3 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyHttpEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/NettyHttpEndpointBuilderFactory.java
@@ -2117,7 +2117,13 @@ public interface NettyHttpEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -2137,7 +2143,13 @@ public interface NettyHttpEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
@@ -3868,7 +3880,13 @@ public interface NettyHttpEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -3888,7 +3906,13 @@ public interface NettyHttpEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
@@ -5077,7 +5101,13 @@ public interface NettyHttpEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -5097,7 +5127,13 @@ public interface NettyHttpEndpointBuilderFactory {
          * body, Out body, fault body, In headers, Out headers, fault headers,
          * exchange properties, exchange exception. This requires that the
          * objects are serializable. Camel will exclude any non-serializable
-         * objects and log it at WARN level.
+         * objects and log it at WARN level. The connection headers
+         * (CamelNettyRemoteAddress, CamelNettyLocalAddress,
+         * CamelNettyChannelHandlerContext, CamelNettySSLSession and the
+         * CamelNettySSLClientCert headers) and the CamelNettyRemoteAddress and
+         * CamelNettyChannel exchange properties are always the ones of the
+         * receiving side: the connection it accepted is the source of truth,
+         * and these values are never taken from the transferred exchange.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 

Reply via email to