activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: ARTEMIS-1158 exposing Netty.channelID properly
Date Thu, 11 May 2017 01:53:27 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master ab6806c38 -> 02dcfe046


ARTEMIS-1158 exposing Netty.channelID properly


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/02dcfe04
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/02dcfe04
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/02dcfe04

Branch: refs/heads/master
Commit: 02dcfe0468126b87b57de75e93bb0065fe500563
Parents: ab6806c
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed May 10 18:06:46 2017 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed May 10 21:50:19 2017 -0400

----------------------------------------------------------------------
 .../core/remoting/impl/netty/ActiveMQChannelHandler.java        | 5 ++---
 .../artemis/core/remoting/impl/netty/NettyConnection.java       | 3 +--
 .../activemq/artemis/tests/integration/client/ConsumerTest.java | 2 ++
 .../unit/core/remoting/impl/netty/NettyConnectionTest.java      | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/02dcfe04/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
index feb19f5..1542b05 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
@@ -57,7 +57,6 @@ public class ActiveMQChannelHandler extends ChannelDuplexHandler {
 
    @Override
    public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
-      // TODO: Think about the id thingy
       listener.connectionReadyForWrites(channelId(ctx.channel()), ctx.channel().isWritable());
    }
 
@@ -107,7 +106,7 @@ public class ActiveMQChannelHandler extends ChannelDuplexHandler {
       }
    }
 
-   protected static int channelId(Channel channel) {
-      return channel.hashCode();
+   protected static Object channelId(Channel channel) {
+      return channel.id();
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/02dcfe04/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
index 2c03ed6..0316b15 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
@@ -266,8 +266,7 @@ public class NettyConnection implements Connection {
 
    @Override
    public final Object getID() {
-      // TODO: Think of it
-      return channel.hashCode();
+      return channel.id();
    }
 
    // This is called periodically to flush the batch buffer

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/02dcfe04/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
index 4a0ef04..28200cf 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java
@@ -111,6 +111,8 @@ public class ConsumerTest extends ActiveMQTestBase {
 
       ClientSessionFactory sf = createSessionFactory(locator);
 
+      ClientSessionFactory sf2 = createSessionFactory(locator);
+
       ClientSession session = sf.createSession(false, true, true, true);
 
       server.createQueue(QUEUE, RoutingType.ANYCAST, QUEUE, null, true, false);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/02dcfe04/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
index 3801e7e..8d8e482 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectionTest.java
@@ -44,7 +44,7 @@ public class NettyConnectionTest extends ActiveMQTestBase {
       Channel channel = createChannel();
       NettyConnection conn = new NettyConnection(emptyMap, channel, new MyListener(), false,
false);
 
-      Assert.assertEquals(channel.hashCode(), conn.getID());
+      Assert.assertEquals(channel.id(), conn.getID());
    }
 
    @Test


Mime
View raw message