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

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

Commit 284ce806186527a29185b2ccefd1c2187ee86ac8 in activemq-artemis's branch 
refs/heads/main from Timothy Bish
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=284ce80618 ]

ARTEMIS-4952 Use getObjectPropertyForFilter when applying filters

When counting messages with provided filters and grouping use the API
getObjectPropertyForFilter which translates values from AMQP message
annotations that are otherwise missed by the filters.


> JMX countMessages: groupBy not working on AMQP messages
> -------------------------------------------------------
>
>                 Key: ARTEMIS-4952
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4952
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: JMX, management
>    Affects Versions: 2.35.0
>            Reporter: nmeylan
>            Priority: Minor
>         Attachments: image-2024-07-25-09-54-32-066.png
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> I encountered weird behavior with JMX _countMessages(String, String)_ when 
> messages are produced via *AMQP* then moved to another queue and when I call 
> *countMessages* operation with a group by
> h2. Context:
> * I create *1600 *messages to *queue.1*, using *CORE* protocol
> * I create *440 *messages to *queue.2*, using *AMQP* protocol
> * I move all messages from *queue.1* to *dl.default* queue, using 
> moveMessages operation
> * I move all messages from *queue.2* to *dl.default* queue, using 
> moveMessages operation
>  
> h2. Current behavior
> Calling *countMessages* operation on queue *dl.default* with a groupBy _ 
> _AMQ_ORIG_QUEUE_ i get:
> {code}
> {"null": 440, "queue.1": 1600}
> {code}
> If I also filter by _ _AMQ_ORIG_QUEUE='queue.2'_ i get
> {code}
> {"null": 440}
> {code}
> !image-2024-07-25-09-54-32-066.png!
>  
> h2. Expected behavior
> Calling *countMessages* operation on queue *dl.default* with a groupBy _ 
> _AMQ_ORIG_QUEUE_ i get:
> {code}
> {"queue.2": 440, "queue.1": 1600}
> {code}
> h2. Notes
> I was wondering why 
> [message.getObjectProperty|https://github.com/apache/activemq-artemis/blob/41ec279e2240fd4a84e1c0e7902623682bc5e785/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java#L1164]
>  is called instead of 
> [message.getObjectPropertyForFilter|https://github.com/apache/activemq-artemis/blob/41ec279e2240fd4a84e1c0e7902623682bc5e785/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java#L237]
>  as for filtering
> I did the test using getObjectPropertyForFilter instead of getObjectProperty 
> and it works



--
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