[ 
https://issues.apache.org/jira/browse/ARTEMIS-4952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

nmeylan updated ARTEMIS-4952:
-----------------------------
    Description: 
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

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


> 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
>            Reporter: nmeylan
>            Priority: Major
>         Attachments: image-2024-07-25-09-54-32-066.png
>
>
> 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