ARTEMIS-1158 exposing Netty.channelID properly
This commit is contained in:
parent
ab6806c38b
commit
02dcfe0468
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue