Repository: camel Updated Branches: refs/heads/master df5c6e7c4 -> 9edce5353
New configuration parameter added : allowSerializedHeaders to activate the transfer of serializable headers and properties objects. see issue https://issues.apache.org/jira/browse/CAMEL-10343 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9edce535 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9edce535 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9edce535 Branch: refs/heads/master Commit: 9edce53537dd98d0d7483eb30e2e6e311d57cb42 Parents: df5c6e7 Author: DUFFILLOT Nicolas <[email protected]> Authored: Wed Sep 28 17:20:22 2016 +0200 Committer: Andrea Cosentino <[email protected]> Committed: Thu Sep 29 08:27:42 2016 +0200 ---------------------------------------------------------------------- .../camel/component/netty4/NettyConfiguration.java | 15 +++++++++++++++ .../camel/component/netty4/NettyPayloadHelper.java | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/9edce535/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java index 789272b..0863290 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java @@ -74,6 +74,8 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem private boolean lazyChannelCreation = true; @UriParam(label = "advanced") private boolean transferExchange; + @UriParam(label = "advanced", defaultValue = "false") + private boolean allowSerializedHeaders; @UriParam(label = "consumer,advanced", defaultValue = "true") private boolean disconnectOnNoReply = true; @UriParam(label = "consumer,advanced", defaultValue = "WARN") @@ -426,6 +428,19 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem this.transferExchange = transferExchange; } + public boolean isAllowSerializedHeaders() { + return allowSerializedHeaders; + } + + /** + * Only used for TCP when transferExchange is true. When set to true, serializable objects in headers and properties + * will be added to the exchange. Otherwise Camel will exclude any non-serializable objects and log it at WARN + * level. + */ + public void setAllowSerializedHeaders(final boolean allowSerializedHeaders) { + this.allowSerializedHeaders = allowSerializedHeaders; + } + public boolean isDisconnectOnNoReply() { return disconnectOnNoReply; } http://git-wip-us.apache.org/repos/asf/camel/blob/9edce535/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java index 83365ce..d2c0731 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java @@ -41,7 +41,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); + return DefaultExchangeHolder.marshal(exchange, true, endpoint.getConfiguration().isAllowSerializedHeaders()); } else { if (endpoint.getConfiguration().isUseByteBuf()) { // Just leverage the type converter
