[ 
https://issues.apache.org/jira/browse/ARTEMIS-5182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17907427#comment-17907427
 ] 

ASF subversion and git services commented on ARTEMIS-5182:
----------------------------------------------------------

Commit 2b7737301f655b33fc31eeff5a7fe4de4c8ee341 in activemq-artemis's branch 
refs/heads/main from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=2b7737301f ]

ARTEMIS-5182 STOMP sub w/noLocal + selector missing messages


> 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
>          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: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to