Repository: camel Updated Branches: refs/heads/camel-2.17.x df2a31a4b -> cf939a692 refs/heads/master 7c4dd0b4f -> 3c11ff553
CAMEL-10051 - Fixed issue with reuse channel. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/96d3ce29 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/96d3ce29 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/96d3ce29 Branch: refs/heads/master Commit: 96d3ce29aadfe801b604b5db1db3581e64eb5ebd Parents: 7c4dd0b Author: grigoriadis <grigoria...@itsaur.com> Authored: Sun Jun 12 15:48:41 2016 +0300 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sun Jun 12 16:26:51 2016 +0200 ---------------------------------------------------------------------- .../org/apache/camel/component/netty4/NettyProducer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/96d3ce29/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java index a6bce2d..81e6cb2 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java @@ -282,7 +282,13 @@ public class NettyProducer extends DefaultAsyncProducer { // need to declare as final final Channel channel = existing; - final AsyncCallback producerCallback = new NettyProducerCallback(channel, callback); + final AsyncCallback producerCallback; + + if(configuration.isReuseChannel()) { + producerCallback = callback; + } else { + producerCallback = new NettyProducerCallback(channel, callback); + } // setup state as attachment on the channel, so we can access the state later when needed putState(channel, new NettyCamelState(producerCallback, exchange));