camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/2] git commit: CAMEL-6921 Find another way to fix the NPE issue
Date Fri, 17 Jan 2014 03:03:22 GMT
Updated Branches:
  refs/heads/camel-2.11.x 365a40c3a -> 525fd0cc3
  refs/heads/camel-2.12.x 511644098 -> f2bb4a1f8


CAMEL-6921 Find another way to fix the NPE issue


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f2bb4a1f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f2bb4a1f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f2bb4a1f

Branch: refs/heads/camel-2.12.x
Commit: f2bb4a1f88c55063cc0bd868147486fb5ff624e2
Parents: 5116440
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Fri Jan 17 10:57:43 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri Jan 17 11:02:08 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/netty/NettyProducer.java     | 3 ++-
 .../camel/component/netty/handlers/ClientChannelHandler.java     | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f2bb4a1f/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
index 2b5faba..1b0a7a7 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java
@@ -514,7 +514,8 @@ public class NettyProducer extends DefaultAsyncProducer {
         @Override
         public void destroyObject(Channel channel) throws Exception {
             LOG.trace("Destroying channel: {}", channel);
-            // noop
+            NettyHelper.close(channel);
+            ALL_CHANNELS.remove(channel);
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/f2bb4a1f/components/camel-netty/src/main/java/org/apache/camel/component/netty/handlers/ClientChannelHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/handlers/ClientChannelHandler.java
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/handlers/ClientChannelHandler.java
index 3d58471..c9f997f 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/handlers/ClientChannelHandler.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/handlers/ClientChannelHandler.java
@@ -136,6 +136,10 @@ public class ClientChannelHandler extends SimpleChannelUpstreamHandler
{
         }
 
         Exchange exchange = getExchange(ctx);
+        if (exchange == null) {
+            // we just ignore the received message as the channel is closed
+            return;
+        }
         AsyncCallback callback = getAsyncCallback(ctx);
 
         Message message;


Mime
View raw message