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
|
@Override
|
||||||
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
||||||
// TODO: Think about the id thingy
|
|
||||||
listener.connectionReadyForWrites(channelId(ctx.channel()), ctx.channel().isWritable());
|
listener.connectionReadyForWrites(channelId(ctx.channel()), ctx.channel().isWritable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +106,7 @@ public class ActiveMQChannelHandler extends ChannelDuplexHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static int channelId(Channel channel) {
|
protected static Object channelId(Channel channel) {
|
||||||
return channel.hashCode();
|
return channel.id();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,8 +266,7 @@ public class NettyConnection implements Connection {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final Object getID() {
|
public final Object getID() {
|
||||||
// TODO: Think of it
|
return channel.id();
|
||||||
return channel.hashCode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is called periodically to flush the batch buffer
|
// This is called periodically to flush the batch buffer
|
||||||
|
|
|
@ -111,6 +111,8 @@ public class ConsumerTest extends ActiveMQTestBase {
|
||||||
|
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
ClientSessionFactory sf = createSessionFactory(locator);
|
||||||
|
|
||||||
|
ClientSessionFactory sf2 = createSessionFactory(locator);
|
||||||
|
|
||||||
ClientSession session = sf.createSession(false, true, true, true);
|
ClientSession session = sf.createSession(false, true, true, true);
|
||||||
|
|
||||||
server.createQueue(QUEUE, RoutingType.ANYCAST, QUEUE, null, true, false);
|
server.createQueue(QUEUE, RoutingType.ANYCAST, QUEUE, null, true, false);
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class NettyConnectionTest extends ActiveMQTestBase {
|
||||||
Channel channel = createChannel();
|
Channel channel = createChannel();
|
||||||
NettyConnection conn = new NettyConnection(emptyMap, channel, new MyListener(), false, false);
|
NettyConnection conn = new NettyConnection(emptyMap, channel, new MyListener(), false, false);
|
||||||
|
|
||||||
Assert.assertEquals(channel.hashCode(), conn.getID());
|
Assert.assertEquals(channel.id(), conn.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue