jbertram commented on code in PR #5414: URL: https://github.com/apache/activemq-artemis/pull/5414#discussion_r1905806644
########## artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java: ########## @@ -231,6 +232,9 @@ public void closed() { public void disconnect(ServerConsumer consumerId, String errorDescription) { StompSubscription stompSubscription = subscriptions.remove(consumerId.getID()); if (stompSubscription != null) { + if (stompSubscription.isNoLocal()) { + noLocalSubscriptionCount.decrementAndGet(); + } Review Comment: Fixed. ########## tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java: ########## @@ -1501,6 +1501,26 @@ public void testSubscribeToTopicWithNoLocal() throws Exception { conn.disconnect(); } + @Test + public void testSubscribeToTopicWithNoLocalAndNormal() throws Exception { + conn.connect(defUser, defPass); + subscribeTopic(conn, RandomUtil.randomString(), null, null, true, true); + subscribeTopic(conn, RandomUtil.randomString(), null, null, true, false); + int normalCount = 0; + int noLocalCount = 0; + for (Binding binding : server.getPostOffice().getBindingsForAddress(SimpleString.of(getTopicPrefix() + getTopicName())).getBindings()) { + if (binding.getFilter() != null && binding.getFilter().getFilterString().toString().contains("__AMQ_CID")) { + noLocalCount++; + } else { + normalCount++; + } + } + assertEquals(1, noLocalCount); + assertEquals(1, normalCount); + + conn.disconnect(); Review Comment: I think I got all the relevant cases. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact