You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2019/08/28 19:54:00 UTC

[jira] [Commented] (ARTEMIS-2463) Message Acknowledge Resets to 0 Whenever the JMS Listener is stop/restarted

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

Justin Bertram commented on ARTEMIS-2463:
-----------------------------------------

I took a look at the attached screenshots and here's what I saw:

* Screenshot 2019-08-28 at 11.02.29 am.png: a command prompt showing a producer sending 20 messages to {{test}} and a consumer receiving 10 messages from {{test}}
* Screenshot 2019-08-28 at 11.03.33 am.png: the view of the {{test}} *address* from the ActiveMQ Artemis web console showing a message count of 10; this is the total number of messages for every queue bound to the address, this view *does not* show the total number of messages acknowledged.
* Screenshot 2019-08-28 at 11.03.46 am.png: the view of the {{test}} *queue* from the ActiveMQ Artemis web console showing a message count of 10, messages acknowledged count of 10, & messages added count of 20
* Screenshot 2019-08-28 at 11.04.38 am.png: the view of the {{test}} *queue* from the ActiveMQ Artemis web console showing a message count of 10, messages acknowledged count of 0, & messages added count of 10

I believe what you're seeing is an artifact of how queue auto-creation and auto-deletion works. When a JMS producer sends a message to a JMS queue which doesn't exist and auto-creation is enabled (which it is by default) then a core address and a core queue are automatically created and the message is routed to that core queue. You can go into the web console and look at all the stats for the queue, etc. However, once a consumer receives & acknowledges that message and disconnects that means there are 0 messages and 0 consumers on the queue so the broker will automatically delete the core queue and the core address (assuming it has no other bindings). This, of course, removes the queue from any management view. If another producer sends a message to a JMS queue with the _same name_ as before the core resources will be created once again. If an unsuspecting user (such as yourself) then looks at the queue from the management console it will appear as if the counters were reset because the number of acknowledged messages on the queue would be 0 even though a message was consumed from a queue with that name previously. However, from the broker's perspective it is a brand new queue that was just auto-created.

If you don't like this behavior then I recommend you disable set the {{<auto-delete-queues>}} {{<address-setting>}} to {{false}} or simply configure the address & queue you want in your broker.xml.

> Message Acknowledge Resets to 0 Whenever the JMS Listener is stop/restarted
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2463
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2463
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Fem
>            Priority: Major
>         Attachments: Screenshot 2019-08-28 at 11.02.29 am.png, Screenshot 2019-08-28 at 11.03.33 am.png, Screenshot 2019-08-28 at 11.03.46 am.png, Screenshot 2019-08-28 at 11.04.38 am.png
>
>
> Hi, regarding the *dequeued count on ActiveMQ*, based on my understanding, the counterpart metric of dequeued count in Artemis is *Message acknowledge* so I was doing an experiment on the consuming of message on Artemis and whether the message acknowledges moves as per the consume messages. I created a JMS Listener on a Java application and the queue is successfully shown the changes on the metric *MessagesAcknowledged* , but whenever the JMS Listener is stopped, the metric resets the value to 0 and had no idea where the value goes. So I tried to do the consuming and producing using the default feature on Artemis as per attached files. And yet I am receiving the same output.
> So I guess its either my metric is incorrect or that Artemis does not save or process where the dequeued messages are. Please help (flag) thanks a lot
>  
> P.S I did this on two versions: 2.7 and 2.9



--
This message was sent by Atlassian Jira
(v8.3.2#803003)