You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Robbie Gemmell (Jira)" <ji...@apache.org> on 2025/01/09 15:53:00 UTC
[jira] [Resolved] (ARTEMIS-5182) STOMP subscriber w/noLocal + selector missing messages
[ https://issues.apache.org/jira/browse/ARTEMIS-5182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robbie Gemmell resolved ARTEMIS-5182.
-------------------------------------
Fix Version/s: 2.40.0
Resolution: Fixed
> STOMP subscriber w/noLocal + selector missing messages
> ------------------------------------------------------
>
> Key: ARTEMIS-5182
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5182
> 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
> Fix For: 2.40.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> If {{noLocal}} is enabled, {{StompConnection.java}} adds {{ AND AMQ_CID<>xxx}} to the selector _without_ wrapping the original expression in parentheses which means not all messages sent to the topic are filtered properly.
> For example, if the original selector is {{{}foo=1 or bar=2{}}}, the new selector will be {{foo=1 or bar=2 and __AMQ_CID<>xxx}}, so messages with only {{foo=1}} won't respect {{noLocal}}.
> Untested potential patch:
> {noformat}
> diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
> index 742c2a8d79..8527eea8a2 100644
> --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
> +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
> @@ -566,7 +566,7 @@ public final class StompConnection extends AbstractRemotingConnection {
> if (selector == null) {
> selector = noLocalFilter;
> } else {
> - selector += " AND " + noLocalFilter;
> + selector = "(" + selector + ") AND " + noLocalFilter;
> }
> }{noformat}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact