diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java index 6b77c04ba7..ead53962b5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java @@ -918,7 +918,7 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener public String toManagementString() { - return "ServerConsumer [id=" + id + ", filter=" + filter + ", binding=" + binding.toManagementString() + "]"; + return "ServerConsumer [id=" + getConnectionID() + ":" + getSessionID() + ":" + id + ", filter=" + filter + ", binding=" + binding.toManagementString() + "]"; } @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java index ac8012b5f8..e6cb6a0076 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java @@ -529,15 +529,25 @@ public class QueueControlTest extends ManagementTestBase assertEquals(msgRec.getIntProperty("key").intValue(), intValue); - assertEquals(1, srvqueue.getDeliveringCount()); + ClientSessionFactory sf2 = createSessionFactory(locator); + ClientSession session2 = sf2.createSession(false, true, false); + ClientConsumer consumer2 = session2.createConsumer(queue); + session2.start(); + ClientMessage msgRec2 = consumer2.receive(5000); + assertNotNull(msgRec2); + + + assertEquals(2, srvqueue.getDeliveringCount()); + assertEquals(2, srvqueue.getConsumerCount()); + assertEquals(2, server.getConnectionCount()); System.out.println(queueControl.listDeliveringMessagesAsJSON()); Map []> deliveringMap = queueControl.listDeliveringMessages(); - assertEquals(1, deliveringMap.size()); - //Map msgs = deliveringMap.get(key) + assertEquals(2, deliveringMap.size()); consumer.close(); + consumer2.close(); session.deleteQueue(queue); }