You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Yi Pan <yp...@yahoo-inc.com> on 2013/05/03 18:52:46 UTC

Question regarding to EnqueueCount and ExpiredCount for topic destination

Hi, all,

We have observed the following behavior in the ActiveMQ destination MBean
stats:
While there is no incoming messages to a topic destination, the EnqueueCount
keeps decreasing instead of stay the same.
Further investigation showed that ExpiredCount is increasing at exactly the
same rate as EnqueueCount decreases:
First run to get stats on the particular destination:
    "ExpiredCount": 1503606
    "EnqueueCount": 170303
Second run:
    "ExpiredCount": 1504372
    "EnqueueCount": 169537

Note that ExpiredCount increased by 766 between the two samples and
EnqueueCount decreased by exactly the same amount.

According to the explanation provided by ActiveMQ official web
(http://activemq.apache.org/how-do-i-find-the-size-of-a-queue.html),
EnqueueCount and ExpiredCount are:
Enqueue Count - the total number of messages sent to the queue since the
last restart
Expired Count - the number of messages that were not delivered because they
were expired

We don't see any reason why those two stats are linked in such a way. Can
someone help to provide some explanation?

Thanks!~

-Yi



--
View this message in context: http://activemq.2283324.n4.nabble.com/Question-regarding-to-EnqueueCount-and-ExpiredCount-for-topic-destination-tp4666634.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Question regarding to EnqueueCount and ExpiredCount for topic destination

Posted by Christian Posta <ch...@gmail.com>.
Thanks for the feedback. I've opened the JIRA here and resolved it:

https://issues.apache.org/jira/browse/AMQ-4516




On Mon, May 6, 2013 at 12:31 PM, Yi Pan <yp...@yahoo-inc.com> wrote:

> Hi, Christian,
>
> Thanks for the quick response. However, the stats and its explanation is
> still very confusing to me.
>
> The standard explanation of Enqueue Count - the total number of messages
> sent to the queue since the last restart. That's counting the action of
> "sent to the queue", not the "number of messages stays in the queue".
> Hence,
> if a message is sent to the queue at t0, it should already been counted
> toward this metric. When this message expires at time t1, it is a change of
> the state of the message (i.e. it expired and no longer needed to be
> delivered). It does not change the fact that it has been "sent to the
> queue"
> at time t0. It seems very confusing to me when ActiveMQ increments the
> counter for "sent" action at t0 and reverts this counter of previous action
> at a later time.
>
> IMHO, it would be much better if we keep the Enqueue Count as simple as the
> number of messages ever made into the queue since restart, while the
> Expired
> Count is an independent metric showing how many messages that were in the
> queue and have expired till now.
>
> Best regards!
>
> -Yi
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Question-regarding-to-EnqueueCount-and-ExpiredCount-for-topic-destination-tp4666634p4666665.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: Question regarding to EnqueueCount and ExpiredCount for topic destination

Posted by Yin Wang <su...@gmail.com>.
+1


2013/5/7 Yi Pan <yp...@yahoo-inc.com>

> Hi, Christian,
>
> Thanks for the quick response. However, the stats and its explanation is
> still very confusing to me.
>
> The standard explanation of Enqueue Count - the total number of messages
> sent to the queue since the last restart. That's counting the action of
> "sent to the queue", not the "number of messages stays in the queue".
> Hence,
> if a message is sent to the queue at t0, it should already been counted
> toward this metric. When this message expires at time t1, it is a change of
> the state of the message (i.e. it expired and no longer needed to be
> delivered). It does not change the fact that it has been "sent to the
> queue"
> at time t0. It seems very confusing to me when ActiveMQ increments the
> counter for "sent" action at t0 and reverts this counter of previous action
> at a later time.
>
> IMHO, it would be much better if we keep the Enqueue Count as simple as the
> number of messages ever made into the queue since restart, while the
> Expired
> Count is an independent metric showing how many messages that were in the
> queue and have expired till now.
>
> Best regards!
>
> -Yi
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Question-regarding-to-EnqueueCount-and-ExpiredCount-for-topic-destination-tp4666634p4666665.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: Question regarding to EnqueueCount and ExpiredCount for topic destination

Posted by Yi Pan <yp...@yahoo-inc.com>.
Hi, Christian,

Thanks for the quick response. However, the stats and its explanation is
still very confusing to me.

The standard explanation of Enqueue Count - the total number of messages
sent to the queue since the last restart. That's counting the action of
"sent to the queue", not the "number of messages stays in the queue". Hence,
if a message is sent to the queue at t0, it should already been counted
toward this metric. When this message expires at time t1, it is a change of
the state of the message (i.e. it expired and no longer needed to be
delivered). It does not change the fact that it has been "sent to the queue"
at time t0. It seems very confusing to me when ActiveMQ increments the
counter for "sent" action at t0 and reverts this counter of previous action
at a later time.

IMHO, it would be much better if we keep the Enqueue Count as simple as the
number of messages ever made into the queue since restart, while the Expired
Count is an independent metric showing how many messages that were in the
queue and have expired till now.

Best regards!

-Yi



--
View this message in context: http://activemq.2283324.n4.nabble.com/Question-regarding-to-EnqueueCount-and-ExpiredCount-for-topic-destination-tp4666634p4666665.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Question regarding to EnqueueCount and ExpiredCount for topic destination

Posted by Christian Posta <ch...@gmail.com>.
Expected behavior, at least based on how the code is written.
Looks like the message is no longer considered "enqueued" once it's
expired. It is no longer waiting for dispatch.


On Fri, May 3, 2013 at 9:52 AM, Yi Pan <yp...@yahoo-inc.com> wrote:

> Hi, all,
>
> We have observed the following behavior in the ActiveMQ destination MBean
> stats:
> While there is no incoming messages to a topic destination, the
> EnqueueCount
> keeps decreasing instead of stay the same.
> Further investigation showed that ExpiredCount is increasing at exactly the
> same rate as EnqueueCount decreases:
> First run to get stats on the particular destination:
>     "ExpiredCount": 1503606
>     "EnqueueCount": 170303
> Second run:
>     "ExpiredCount": 1504372
>     "EnqueueCount": 169537
>
> Note that ExpiredCount increased by 766 between the two samples and
> EnqueueCount decreased by exactly the same amount.
>
> According to the explanation provided by ActiveMQ official web
> (http://activemq.apache.org/how-do-i-find-the-size-of-a-queue.html),
> EnqueueCount and ExpiredCount are:
> Enqueue Count - the total number of messages sent to the queue since the
> last restart
> Expired Count - the number of messages that were not delivered because they
> were expired
>
> We don't see any reason why those two stats are linked in such a way. Can
> someone help to provide some explanation?
>
> Thanks!~
>
> -Yi
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Question-regarding-to-EnqueueCount-and-ExpiredCount-for-topic-destination-tp4666634.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta