CAMEL-9368 - don't fail the exchange if we actually specify to disconnect
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9c8b250e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9c8b250e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9c8b250e Branch: refs/heads/camel-2.16.x Commit: 9c8b250e49066cc933adbe23d49f822a77401294 Parents: 0535e48 Author: Jonathan Anstey <jans...@gmail.com> Authored: Thu Dec 17 15:55:09 2015 -0330 Committer: Jonathan Anstey <jans...@gmail.com> Committed: Thu Dec 17 15:59:53 2015 -0330 ---------------------------------------------------------------------- .../camel/component/netty4/handlers/ClientChannelHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/9c8b250e/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 8905540..160adf4 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 @@ -121,7 +121,10 @@ public class ClientChannelHandler extends SimpleChannelInboundHandler<Object> { if (LOG.isDebugEnabled()) { LOG.debug("Channel closed but no message received from address: {}", address); } - exchange.setException(new CamelExchangeException("No response received from remote server: " + address, exchange)); + // don't fail the exchange if we actually specify to disconnect + if (!configuration.isDisconnect()) { + exchange.setException(new CamelExchangeException("No response received from remote server: " + address, exchange)); + } // signal callback callback.done(false); }