Repository: camel Updated Branches: refs/heads/camel-2.15.x 1805c6b45 -> 8881b79d4 refs/heads/camel-2.16.x 335e7a819 -> f4382b6d5 refs/heads/master 34a45a4bd -> 45bd634f7
CAMEL-9527: Netty client - When channel is inactive we should not log stacktrace if the message was received and processed Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9391f007 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9391f007 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9391f007 Branch: refs/heads/master Commit: 9391f0077ed0bfa5f7588859e91eaf342f8c45fa Parents: 34a45a4 Author: Claus Ibsen <davscl...@apache.org> Authored: Sun Jan 24 12:15:59 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sun Jan 24 12:15:59 2016 +0100 ---------------------------------------------------------------------- .../component/netty4/handlers/ClientChannelHandler.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/9391f007/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/handlers/ClientChannelHandler.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/handlers/ClientChannelHandler.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/handlers/ClientChannelHandler.java index 160adf4..dbb7b60 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/handlers/ClientChannelHandler.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/handlers/ClientChannelHandler.java @@ -112,7 +112,7 @@ public class ClientChannelHandler extends SimpleChannelInboundHandler<Object> { producer.getAllChannels().remove(ctx.channel()); NettyConfiguration configuration = producer.getConfiguration(); - if (configuration.isSync() && !exceptionHandled) { + if (configuration.isSync() && !messageReceived && !exceptionHandled) { // To avoid call the callback.done twice exceptionHandled = true; // session was closed but no message received. This could be because the remote server had an internal error @@ -201,6 +201,13 @@ public class ClientChannelHandler extends SimpleChannelInboundHandler<Object> { } } + @Override + public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { + // reset flag after we have read the complete + messageReceived = false; + super.channelReadComplete(ctx); + } + /** * Gets the Camel {@link Message} to use as the message to be set on the current {@link Exchange} when * we have received a reply message.