[
https://issues.apache.org/jira/browse/ARTEMIS-5184?focusedWorklogId=951202&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-951202
]
ASF GitHub Bot logged work on ARTEMIS-5184:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jan/25 17:16
Start Date: 07/Jan/25 17:16
Worklog Time Spent: 10m
Work Description: 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.
Issue Time Tracking
-------------------
Worklog Id: (was: 951202)
Time Spent: 0.5h (was: 20m)
> STOMP noLocal is scoped to session not subscription
> ---------------------------------------------------
>
> Key: ARTEMIS-5184
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5184
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: STOMP
> Affects Versions: 2.37.0
> Reporter: Tommy Lindgren
> Assignee: Justin Bertram
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> It looks like {{activemq.noLocal}} is scoped to the Stomp session, not the
> subscription, i.e. {{noLocal}} for the last subscription decides what setting
> all subscriptions will use. I believe this is a regression from ActiveMQ
> Classic.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact