You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Neha Sareen <ne...@oracle.com> on 2018/06/25 17:37:41 UTC

Questions on queue message counters

Hi,

 

We are working with Apache Artemis 2.4.0 and have some questions related to the queue message counters.

 

I have been looking at the org.apache.activemq.artemis.api.core.management.QueueControl interface to get info around the queue message counter related APIs.

 

1.       Trying to understand the HYPERLINK "https://activemq.apache.org/artemis/docs/javadocs/javadoc-latest/org/apache/activemq/artemis/api/core/management/QueueControl.html#resetMessageCounter--"resetMessageCounter() API. Does this reset all the queue counters to 0? Also, does it set a reset time, which we can leverage further? If yes, which field would signify that?

2.       How can we determine the number of messages added/enqueued to a queue since the last reset time?

3.       How do we determine  the number of messages consumed/dequeued from a queue since the last reset time?

4.       For 2 above, I do see a getMessagesAdded() API which states that this returns the number of messages added to the queue since it was created. If the queue message counters are reset, would this API still return number of messages added since the queue was created or since the last reset?

5.       Is there an API to get the high queue depth or the maximum number of messages in a queue since the last reset time?

6.       If there are no APIs that answer 2, 3, 4 and 5 above, can we somehow derive or calculate these values from an API that Artemis provides today?

 

Would appreciate if someone can clarify these.

 

 

Thanks

Neha

Oracle Marketing Cloud

 

RE: Questions on queue message counters

Posted by Neha Sareen <ne...@oracle.com>.
Thanks for the information Justin.

Thanks
Neha

-----Original Message-----
From: Justin Bertram <jb...@apache.org> 
Sent: Wednesday, August 01, 2018 2:30 PM
To: users@activemq.apache.org
Subject: Re: Questions on queue message counters

Sorry for the late reply on this...

> I am looking at 
> org.apache.activemq.artemis.api.core.management.MessageCounterInfo
class @ https://urldefense.proofpoint.com/v2/url?u=https-3A__activemq.apache.org_artemis_docs_javadocs_javadoc-2D&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=5tPBRTL9wtASwt-7By7kU2hfFq_MyirHE2F_FpAofrA&s=8RPMS9CiKhLCXRXrHvXau8Dw4gIf1j2Ad-UamqmwrJI&e=
latest/index.html and I do not see the "messageCountDelta" attribute here.
Can you please clarify this?

I apologize for the confusion.  When the raw data from the internal message counter object is converted from JSON into the MessageCounterInfo some attribute names are changed.  See the code here [1].  As you can see, the "messageCountDelta" from the broker is translated into "depthDelta".

> Also, what are the fields lastAddTimestamp and updateTimestamp reset to?
Is there a specific value they are reset to or reset to the time when we last invoked the resetMessageCounter() API?

They are reset to 0.

> What do we mean by last counter sample and how is this sampling time
calculated? Does this sample time, in any way, correlate to the reset updateTimestamp?

The message counters are not updated every single time the underlying queue is updated as that would negatively impact performance.  Therefore, the message counter is updated every 10 seconds by default.  This period is controlled by <message-counter-sample-period> in broker.xml.  All this is outlined in the documentation.

Every time the message counter is updated the updateTimestamp is updated with the correspond time.

> For our case, to be able to use and invoke the MessageCounter APIs 
> from
our application (client side), the only support we have is to use the Jolokia API as this class is not available in the 2.4.0 client library.

See ARTEMIS-1956 [2].  This should not be an issue in future releases.


Justin

[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_activemq-2Dartemis_blob_master_artemis-2Dcore-2Dclient_src_main_java_org_apache_activemq_artemis_api_core_management_MessageCounterInfo.java-23L51&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=5tPBRTL9wtASwt-7By7kU2hfFq_MyirHE2F_FpAofrA&s=Nkp-BkYUgP5mWska3yn7YN0or9dpl1CjfL_C1cXCsrY&e=
[2] https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.apache.org_jira_browse_ARTEMIS-2D1956&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=5tPBRTL9wtASwt-7By7kU2hfFq_MyirHE2F_FpAofrA&s=FAxsD-W3AQLjypqUKJbvpPeImEZQm79qLqC0dP1I3-I&e=



On Wed, Jun 27, 2018 at 4:32 PM, Neha Sareen <ne...@oracle.com> wrote:

> Hi Justin,
>
> I have some follow up questions here to your response as I try to 
> correlate this with the official Artemis API documentation:
>
> 1. > Trying to understand the resetMessageCounter() API. Does this 
> reset
> > all
> the queue counters to 0? Also, does it set a reset time, which we can 
> leverage further? If yes, which field would signify that?
>
> Calling resetMessageCounter() will reset count, countDelta, 
> messageCountDelta, lastAddTimestamp, & udpateTimestamp.  The 
> messageCount is not reset as it comes directly from the underlying 
> queue.  No reset time is set.
> Neha: I am looking at 
> org.apache.activemq.artemis.api.core.management.MessageCounterInfo
> class @ 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__activemq.apache.o
> rg_artemis_docs_javadocs_javadoc-2D&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh
> 8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=5
> tPBRTL9wtASwt-7By7kU2hfFq_MyirHE2F_FpAofrA&s=8RPMS9CiKhLCXRXrHvXau8Dw4
> gIf1j2Ad-UamqmwrJI&e= latest/index.html and I do not see the 
> "messageCountDelta" attribute here. Can you please clarify this? Also, 
> what are the fields lastAddTimestamp and updateTimestamp reset to? Is 
> there a specific value they are reset to or reset to the time when we 
> last invoked the
> resetMessageCounter() API?
>
> 2. > How can we determine the number of messages added/enqueued to a 
> queue since the last reset time?
>
> Use the "count" property.
> Neha: getCount() API specifies that it "Returns the number of messages 
> added to the queue since it was created" while getCountDelta() API 
> specifies that it "Returns the number of messages added to the queue 
> since the last counter sample". What do we mean by last counter sample 
> and how is this sampling time calculated? Does this sample time, in 
> any way, correlate to the reset updateTimestamp?
>
> 3. > How do we determine  the number of messages consumed/dequeued 
> from a queue since the last reset time?
>
> I don't believe you can determine the number of messages 
> consumed/dequeued from a queue since the last reset time.  However, 
> you can determine the number of messages consumed/dequeued from a 
> queue since the last counter update by subtracting "messageCountDelta" from "countDelta."
>
> Neha: Again here I do not see any reference to "messageCountDelta"
> property in the API docs.
>
> 4. What do we mean by updateTimestamp()? The APi states that it 
> returns the timestamp when the queue was updated. What are the 
> scenarios when queue is updated? As per your response, this value is 
> also reset when
> resetMessageCounters() API is invoked. Is that the only case when this 
> timestamp is updated or other cases as well?
>
> 5. For our case, to be able to use and invoke the MessageCounter APIs 
> from our application (client side), the only support we have is to use 
> the Jolokia API as this class is not available in the 2.4.0 client 
> library. Can you provide or point us to a sample of a curl request 
> using the Jolokia APi to query an attribute or executing an operation 
> for a queue using MessageCounterInfo?
>
> Thanks
> Neha
>
>
> -----Original Message-----
> From: Justin Bertram <jb...@apache.org>
> Sent: Tuesday, June 26, 2018 10:39 AM
> To: users@activemq.apache.org
> Subject: Re: Questions on queue message counters
>
> > Trying to understand the resetMessageCounter() API. Does this reset 
> > all
> the queue counters to 0? Also, does it set a reset time, which we can 
> leverage further? If yes, which field would signify that?
>
> Calling resetMessageCounter() will reset count, countDelta, 
> messageCountDelta, lastAddTimestamp, & udpateTimestamp.  The 
> messageCount is not reset as it comes directly from the underlying 
> queue.  No reset time is set.
>
> > How can we determine the number of messages added/enqueued to a 
> > queue
> since the last reset time?
>
> Use the "count" property.
>
> > How do we determine  the number of messages consumed/dequeued from a
> queue since the last reset time?
>
> I don't believe you can determine the number of messages 
> consumed/dequeued from a queue since the last reset time.  However, 
> you can determine the number of messages consumed/dequeued from a 
> queue since the last counter update by subtracting "messageCountDelta" from "countDelta."
>
> > For 2 above, I do see a getMessagesAdded() API which states that 
> > this
> returns the number of messages added to the queue since it was 
> created. If the queue message counters are reset, would this API still 
> return number of messages added since the queue was created or since the last reset?
>
> Resetting the message counter has no impact on the metrics available 
> on the QueueControl itself.  If you want to reset the value returned 
> by
> getMessagesAdded() then you should call resetMessagesAdded() on the 
> QueueControl.
>
> > Is there an API to get the high queue depth or the maximum number of
> messages in a queue since the last reset time?
>
> No.
>
> > If there are no APIs that answer 2, 3, 4 and 5 above, can we somehow
> derive or calculate these values from an API that Artemis provides today?
>
> It varies.  I've included possible alternatives in the previous 
> answers where applicable.
>
>
> Justin
>
> On Mon, Jun 25, 2018 at 1:33 PM, Neha Sareen <ne...@oracle.com>
> wrote:
>
> > Iterating point 1 again,( not sure how this was converted to a
> > Hyperlink)
> >
> > 1. Trying to understand the resetMessageCounter() API. Does this 
> > reset all the queue counters to 0? Also, does it set a reset time, 
> > which we can leverage further? If yes, which field would signify that?
> >
> > Thanks
> > Neha
> >
> > -----Original Message-----
> > From: Neha Sareen
> > Sent: Monday, June 25, 2018 10:38 AM
> > To: users@activemq.apache.org
> > Subject: Questions on queue message counters
> >
> > Hi,
> >
> >
> >
> > We are working with Apache Artemis 2.4.0 and have some questions 
> > related to the queue message counters.
> >
> >
> >
> > I have been looking at the org.apache.activemq.artemis.
> > api.core.management.QueueControl interface to get info around the 
> > queue message counter related APIs.
> >
> >
> >
> > 1.       Trying to understand the HYPERLINK "https://urldefense.proofpoint.com/v2/url?u=https-3A__urldefense&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=5tPBRTL9wtASwt-7By7kU2hfFq_MyirHE2F_FpAofrA&s=8PBLA2hNBMvQ1_K-_32OjWqi3PG2SqIz9pTAC8dDdO0&e=.
> proofpoint.com/v2/url?u=https-3A__urldefense&d=DwIBaQ&c=
> RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_
> IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=QW1EO588upgPE8dYnkPUvRw-
> iAfkkqTLIJ1wZJx3-IM&s=NuIU2K5kPBrxiZ8wRqazt1IK8zuqGLCunEaWPFkFs5c&e=.
> > proofpoint.com/v2/url?u=https-3A__activemq.apache.org_
> > artemis_docs_javadocs_javadoc-2Dlatest_org_apache_activemq_
> > artemis_api_core_management_QueueControl.html-23resetMessageCounter-
> > 2D
> > -2D-
> > 2522resetMessageCounter-28-29&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7
> > qI r MUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=
> > gkYvDx8RnaT70E66rKs5Jo0OkjeMVwp9CiHP_MPUCDI&s=
> > 9whYnHNIAmfwgvYeuoC9Fl04FVLqiytMuwsvYGS9z1Y&e= API. Does this reset 
> > all the queue counters to 0? Also, does it set a reset time, which 
> > we can leverage further? If yes, which field would signify that?
> >
> > 2.       How can we determine the number of messages added/enqueued to a
> > queue since the last reset time?
> >
> > 3.       How do we determine  the number of messages consumed/dequeued
> > from a queue since the last reset time?
> >
> > 4.       For 2 above, I do see a getMessagesAdded() API which states that
> > this returns the number of messages added to the queue since it was 
> > created. If the queue message counters are reset, would this API 
> > still return number of messages added since the queue was created or 
> > since the last reset?
> >
> > 5.       Is there an API to get the high queue depth or the maximum
> number
> > of messages in a queue since the last reset time?
> >
> > 6.       If there are no APIs that answer 2, 3, 4 and 5 above, can we
> > somehow derive or calculate these values from an API that Artemis 
> > provides today?
> >
> >
> >
> > Would appreciate if someone can clarify these.
> >
> >
> >
> >
> >
> > Thanks
> >
> > Neha
> >
> > Oracle Marketing Cloud
> >
> >
> >
>

Re: Questions on queue message counters

Posted by Justin Bertram <jb...@apache.org>.
Sorry for the late reply on this...

> I am looking at org.apache.activemq.artemis.api.core.management.MessageCounterInfo
class @ https://activemq.apache.org/artemis/docs/javadocs/javadoc-
latest/index.html and I do not see the "messageCountDelta" attribute here.
Can you please clarify this?

I apologize for the confusion.  When the raw data from the internal message
counter object is converted from JSON into the MessageCounterInfo some
attribute names are changed.  See the code here [1].  As you can see, the
"messageCountDelta" from the broker is translated into "depthDelta".

> Also, what are the fields lastAddTimestamp and updateTimestamp reset to?
Is there a specific value they are reset to or reset to the time when we
last invoked the resetMessageCounter() API?

They are reset to 0.

> What do we mean by last counter sample and how is this sampling time
calculated? Does this sample time, in any way, correlate to the reset
updateTimestamp?

The message counters are not updated every single time the underlying queue
is updated as that would negatively impact performance.  Therefore, the
message counter is updated every 10 seconds by default.  This period is
controlled by <message-counter-sample-period> in broker.xml.  All this is
outlined in the documentation.

Every time the message counter is updated the updateTimestamp is updated
with the correspond time.

> For our case, to be able to use and invoke the MessageCounter APIs from
our application (client side), the only support we have is to use the
Jolokia API as this class is not available in the 2.4.0 client library.

See ARTEMIS-1956 [2].  This should not be an issue in future releases.


Justin

[1]
https://github.com/apache/activemq-artemis/blob/master/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/MessageCounterInfo.java#L51
[2] https://issues.apache.org/jira/browse/ARTEMIS-1956



On Wed, Jun 27, 2018 at 4:32 PM, Neha Sareen <ne...@oracle.com> wrote:

> Hi Justin,
>
> I have some follow up questions here to your response as I try to
> correlate this with the official Artemis API documentation:
>
> 1. > Trying to understand the resetMessageCounter() API. Does this reset
> > all
> the queue counters to 0? Also, does it set a reset time, which we can
> leverage further? If yes, which field would signify that?
>
> Calling resetMessageCounter() will reset count, countDelta,
> messageCountDelta, lastAddTimestamp, & udpateTimestamp.  The messageCount
> is not reset as it comes directly from the underlying queue.  No reset time
> is set.
> Neha: I am looking at org.apache.activemq.artemis.api.core.management.MessageCounterInfo
> class @ https://activemq.apache.org/artemis/docs/javadocs/javadoc-
> latest/index.html and I do not see the "messageCountDelta" attribute
> here. Can you please clarify this? Also, what are the fields
> lastAddTimestamp and updateTimestamp reset to? Is there a specific value
> they are reset to or reset to the time when we last invoked the
> resetMessageCounter() API?
>
> 2. > How can we determine the number of messages added/enqueued to a queue
> since the last reset time?
>
> Use the "count" property.
> Neha: getCount() API specifies that it "Returns the number of messages
> added to the queue since it was created" while getCountDelta() API
> specifies that it "Returns the number of messages added to the queue since
> the last counter sample". What do we mean by last counter sample and how is
> this sampling time calculated? Does this sample time, in any way, correlate
> to the reset updateTimestamp?
>
> 3. > How do we determine  the number of messages consumed/dequeued from a
> queue since the last reset time?
>
> I don't believe you can determine the number of messages consumed/dequeued
> from a queue since the last reset time.  However, you can determine the
> number of messages consumed/dequeued from a queue since the last counter
> update by subtracting "messageCountDelta" from "countDelta."
>
> Neha: Again here I do not see any reference to "messageCountDelta"
> property in the API docs.
>
> 4. What do we mean by updateTimestamp()? The APi states that it returns
> the timestamp when the queue was updated. What are the scenarios when queue
> is updated? As per your response, this value is also reset when
> resetMessageCounters() API is invoked. Is that the only case when this
> timestamp is updated or other cases as well?
>
> 5. For our case, to be able to use and invoke the MessageCounter APIs from
> our application (client side), the only support we have is to use the
> Jolokia API as this class is not available in the 2.4.0 client library. Can
> you provide or point us to a sample of a curl request using the Jolokia APi
> to query an attribute or executing an operation for a queue using
> MessageCounterInfo?
>
> Thanks
> Neha
>
>
> -----Original Message-----
> From: Justin Bertram <jb...@apache.org>
> Sent: Tuesday, June 26, 2018 10:39 AM
> To: users@activemq.apache.org
> Subject: Re: Questions on queue message counters
>
> > Trying to understand the resetMessageCounter() API. Does this reset
> > all
> the queue counters to 0? Also, does it set a reset time, which we can
> leverage further? If yes, which field would signify that?
>
> Calling resetMessageCounter() will reset count, countDelta,
> messageCountDelta, lastAddTimestamp, & udpateTimestamp.  The messageCount
> is not reset as it comes directly from the underlying queue.  No reset time
> is set.
>
> > How can we determine the number of messages added/enqueued to a queue
> since the last reset time?
>
> Use the "count" property.
>
> > How do we determine  the number of messages consumed/dequeued from a
> queue since the last reset time?
>
> I don't believe you can determine the number of messages consumed/dequeued
> from a queue since the last reset time.  However, you can determine the
> number of messages consumed/dequeued from a queue since the last counter
> update by subtracting "messageCountDelta" from "countDelta."
>
> > For 2 above, I do see a getMessagesAdded() API which states that this
> returns the number of messages added to the queue since it was created. If
> the queue message counters are reset, would this API still return number of
> messages added since the queue was created or since the last reset?
>
> Resetting the message counter has no impact on the metrics available on
> the QueueControl itself.  If you want to reset the value returned by
> getMessagesAdded() then you should call resetMessagesAdded() on the
> QueueControl.
>
> > Is there an API to get the high queue depth or the maximum number of
> messages in a queue since the last reset time?
>
> No.
>
> > If there are no APIs that answer 2, 3, 4 and 5 above, can we somehow
> derive or calculate these values from an API that Artemis provides today?
>
> It varies.  I've included possible alternatives in the previous answers
> where applicable.
>
>
> Justin
>
> On Mon, Jun 25, 2018 at 1:33 PM, Neha Sareen <ne...@oracle.com>
> wrote:
>
> > Iterating point 1 again,( not sure how this was converted to a
> > Hyperlink)
> >
> > 1. Trying to understand the resetMessageCounter() API. Does this reset
> > all the queue counters to 0? Also, does it set a reset time, which we
> > can leverage further? If yes, which field would signify that?
> >
> > Thanks
> > Neha
> >
> > -----Original Message-----
> > From: Neha Sareen
> > Sent: Monday, June 25, 2018 10:38 AM
> > To: users@activemq.apache.org
> > Subject: Questions on queue message counters
> >
> > Hi,
> >
> >
> >
> > We are working with Apache Artemis 2.4.0 and have some questions
> > related to the queue message counters.
> >
> >
> >
> > I have been looking at the org.apache.activemq.artemis.
> > api.core.management.QueueControl interface to get info around the
> > queue message counter related APIs.
> >
> >
> >
> > 1.       Trying to understand the HYPERLINK "https://urldefense.
> proofpoint.com/v2/url?u=https-3A__urldefense&d=DwIBaQ&c=
> RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_
> IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=QW1EO588upgPE8dYnkPUvRw-
> iAfkkqTLIJ1wZJx3-IM&s=NuIU2K5kPBrxiZ8wRqazt1IK8zuqGLCunEaWPFkFs5c&e=.
> > proofpoint.com/v2/url?u=https-3A__activemq.apache.org_
> > artemis_docs_javadocs_javadoc-2Dlatest_org_apache_activemq_
> > artemis_api_core_management_QueueControl.html-23resetMessageCounter-2D
> > -2D-
> > 2522resetMessageCounter-28-29&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qI
> > r MUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=
> > gkYvDx8RnaT70E66rKs5Jo0OkjeMVwp9CiHP_MPUCDI&s=
> > 9whYnHNIAmfwgvYeuoC9Fl04FVLqiytMuwsvYGS9z1Y&e= API. Does this reset
> > all the queue counters to 0? Also, does it set a reset time, which we
> > can leverage further? If yes, which field would signify that?
> >
> > 2.       How can we determine the number of messages added/enqueued to a
> > queue since the last reset time?
> >
> > 3.       How do we determine  the number of messages consumed/dequeued
> > from a queue since the last reset time?
> >
> > 4.       For 2 above, I do see a getMessagesAdded() API which states that
> > this returns the number of messages added to the queue since it was
> > created. If the queue message counters are reset, would this API still
> > return number of messages added since the queue was created or since
> > the last reset?
> >
> > 5.       Is there an API to get the high queue depth or the maximum
> number
> > of messages in a queue since the last reset time?
> >
> > 6.       If there are no APIs that answer 2, 3, 4 and 5 above, can we
> > somehow derive or calculate these values from an API that Artemis
> > provides today?
> >
> >
> >
> > Would appreciate if someone can clarify these.
> >
> >
> >
> >
> >
> > Thanks
> >
> > Neha
> >
> > Oracle Marketing Cloud
> >
> >
> >
>

RE: Questions on queue message counters

Posted by Neha Sareen <ne...@oracle.com>.
Hi Justin,

I have some follow up questions here to your response as I try to correlate this with the official Artemis API documentation:

1. > Trying to understand the resetMessageCounter() API. Does this reset 
> all
the queue counters to 0? Also, does it set a reset time, which we can leverage further? If yes, which field would signify that?

Calling resetMessageCounter() will reset count, countDelta, messageCountDelta, lastAddTimestamp, & udpateTimestamp.  The messageCount is not reset as it comes directly from the underlying queue.  No reset time is set.
Neha: I am looking at org.apache.activemq.artemis.api.core.management.MessageCounterInfo class @ https://activemq.apache.org/artemis/docs/javadocs/javadoc-latest/index.html and I do not see the "messageCountDelta" attribute here. Can you please clarify this? Also, what are the fields lastAddTimestamp and updateTimestamp reset to? Is there a specific value they are reset to or reset to the time when we last invoked the resetMessageCounter() API?

2. > How can we determine the number of messages added/enqueued to a queue
since the last reset time?

Use the "count" property.
Neha: getCount() API specifies that it "Returns the number of messages added to the queue since it was created" while getCountDelta() API specifies that it "Returns the number of messages added to the queue since the last counter sample". What do we mean by last counter sample and how is this sampling time calculated? Does this sample time, in any way, correlate to the reset updateTimestamp?

3. > How do we determine  the number of messages consumed/dequeued from a
queue since the last reset time?

I don't believe you can determine the number of messages consumed/dequeued from a queue since the last reset time.  However, you can determine the number of messages consumed/dequeued from a queue since the last counter update by subtracting "messageCountDelta" from "countDelta."

Neha: Again here I do not see any reference to "messageCountDelta" property in the API docs.

4. What do we mean by updateTimestamp()? The APi states that it returns the timestamp when the queue was updated. What are the scenarios when queue is updated? As per your response, this value is also reset when resetMessageCounters() API is invoked. Is that the only case when this timestamp is updated or other cases as well?

5. For our case, to be able to use and invoke the MessageCounter APIs from our application (client side), the only support we have is to use the Jolokia API as this class is not available in the 2.4.0 client library. Can you provide or point us to a sample of a curl request using the Jolokia APi to query an attribute or executing an operation for a queue using MessageCounterInfo?

Thanks
Neha


-----Original Message-----
From: Justin Bertram <jb...@apache.org> 
Sent: Tuesday, June 26, 2018 10:39 AM
To: users@activemq.apache.org
Subject: Re: Questions on queue message counters

> Trying to understand the resetMessageCounter() API. Does this reset 
> all
the queue counters to 0? Also, does it set a reset time, which we can leverage further? If yes, which field would signify that?

Calling resetMessageCounter() will reset count, countDelta, messageCountDelta, lastAddTimestamp, & udpateTimestamp.  The messageCount is not reset as it comes directly from the underlying queue.  No reset time is set.

> How can we determine the number of messages added/enqueued to a queue
since the last reset time?

Use the "count" property.

> How do we determine  the number of messages consumed/dequeued from a
queue since the last reset time?

I don't believe you can determine the number of messages consumed/dequeued from a queue since the last reset time.  However, you can determine the number of messages consumed/dequeued from a queue since the last counter update by subtracting "messageCountDelta" from "countDelta."

> For 2 above, I do see a getMessagesAdded() API which states that this
returns the number of messages added to the queue since it was created. If the queue message counters are reset, would this API still return number of messages added since the queue was created or since the last reset?

Resetting the message counter has no impact on the metrics available on the QueueControl itself.  If you want to reset the value returned by
getMessagesAdded() then you should call resetMessagesAdded() on the QueueControl.

> Is there an API to get the high queue depth or the maximum number of
messages in a queue since the last reset time?

No.

> If there are no APIs that answer 2, 3, 4 and 5 above, can we somehow
derive or calculate these values from an API that Artemis provides today?

It varies.  I've included possible alternatives in the previous answers where applicable.


Justin

On Mon, Jun 25, 2018 at 1:33 PM, Neha Sareen <ne...@oracle.com> wrote:

> Iterating point 1 again,( not sure how this was converted to a 
> Hyperlink)
>
> 1. Trying to understand the resetMessageCounter() API. Does this reset 
> all the queue counters to 0? Also, does it set a reset time, which we 
> can leverage further? If yes, which field would signify that?
>
> Thanks
> Neha
>
> -----Original Message-----
> From: Neha Sareen
> Sent: Monday, June 25, 2018 10:38 AM
> To: users@activemq.apache.org
> Subject: Questions on queue message counters
>
> Hi,
>
>
>
> We are working with Apache Artemis 2.4.0 and have some questions 
> related to the queue message counters.
>
>
>
> I have been looking at the org.apache.activemq.artemis.
> api.core.management.QueueControl interface to get info around the 
> queue message counter related APIs.
>
>
>
> 1.       Trying to understand the HYPERLINK "https://urldefense.proofpoint.com/v2/url?u=https-3A__urldefense&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=QW1EO588upgPE8dYnkPUvRw-iAfkkqTLIJ1wZJx3-IM&s=NuIU2K5kPBrxiZ8wRqazt1IK8zuqGLCunEaWPFkFs5c&e=.
> proofpoint.com/v2/url?u=https-3A__activemq.apache.org_
> artemis_docs_javadocs_javadoc-2Dlatest_org_apache_activemq_
> artemis_api_core_management_QueueControl.html-23resetMessageCounter-2D
> -2D- 
> 2522resetMessageCounter-28-29&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qI
> r MUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=
> gkYvDx8RnaT70E66rKs5Jo0OkjeMVwp9CiHP_MPUCDI&s=
> 9whYnHNIAmfwgvYeuoC9Fl04FVLqiytMuwsvYGS9z1Y&e= API. Does this reset 
> all the queue counters to 0? Also, does it set a reset time, which we 
> can leverage further? If yes, which field would signify that?
>
> 2.       How can we determine the number of messages added/enqueued to a
> queue since the last reset time?
>
> 3.       How do we determine  the number of messages consumed/dequeued
> from a queue since the last reset time?
>
> 4.       For 2 above, I do see a getMessagesAdded() API which states that
> this returns the number of messages added to the queue since it was 
> created. If the queue message counters are reset, would this API still 
> return number of messages added since the queue was created or since 
> the last reset?
>
> 5.       Is there an API to get the high queue depth or the maximum number
> of messages in a queue since the last reset time?
>
> 6.       If there are no APIs that answer 2, 3, 4 and 5 above, can we
> somehow derive or calculate these values from an API that Artemis 
> provides today?
>
>
>
> Would appreciate if someone can clarify these.
>
>
>
>
>
> Thanks
>
> Neha
>
> Oracle Marketing Cloud
>
>
>

Re: Questions on queue message counters

Posted by Justin Bertram <jb...@apache.org>.
> Trying to understand the resetMessageCounter() API. Does this reset all
the queue counters to 0? Also, does it set a reset time, which we can
leverage further? If yes, which field would signify that?

Calling resetMessageCounter() will reset count, countDelta,
messageCountDelta, lastAddTimestamp, & udpateTimestamp.  The messageCount
is not reset as it comes directly from the underlying queue.  No reset time
is set.

> How can we determine the number of messages added/enqueued to a queue
since the last reset time?

Use the "count" property.

> How do we determine  the number of messages consumed/dequeued from a
queue since the last reset time?

I don't believe you can determine the number of messages consumed/dequeued
from a queue since the last reset time.  However, you can determine the
number of messages consumed/dequeued from a queue since the last counter
update by subtracting "messageCountDelta" from "countDelta."

> For 2 above, I do see a getMessagesAdded() API which states that this
returns the number of messages added to the queue since it was created. If
the queue message counters are reset, would this API still return number of
messages added since the queue was created or since the last reset?

Resetting the message counter has no impact on the metrics available on the
QueueControl itself.  If you want to reset the value returned by
getMessagesAdded() then you should call resetMessagesAdded() on the
QueueControl.

> Is there an API to get the high queue depth or the maximum number of
messages in a queue since the last reset time?

No.

> If there are no APIs that answer 2, 3, 4 and 5 above, can we somehow
derive or calculate these values from an API that Artemis provides today?

It varies.  I've included possible alternatives in the previous answers
where applicable.


Justin

On Mon, Jun 25, 2018 at 1:33 PM, Neha Sareen <ne...@oracle.com> wrote:

> Iterating point 1 again,( not sure how this was converted to a Hyperlink)
>
> 1. Trying to understand the resetMessageCounter() API. Does this reset all
> the queue counters to 0? Also, does it set a reset time, which we can
> leverage further? If yes, which field would signify that?
>
> Thanks
> Neha
>
> -----Original Message-----
> From: Neha Sareen
> Sent: Monday, June 25, 2018 10:38 AM
> To: users@activemq.apache.org
> Subject: Questions on queue message counters
>
> Hi,
>
>
>
> We are working with Apache Artemis 2.4.0 and have some questions related
> to the queue message counters.
>
>
>
> I have been looking at the org.apache.activemq.artemis.
> api.core.management.QueueControl interface to get info around the queue
> message counter related APIs.
>
>
>
> 1.       Trying to understand the HYPERLINK "https://urldefense.
> proofpoint.com/v2/url?u=https-3A__activemq.apache.org_
> artemis_docs_javadocs_javadoc-2Dlatest_org_apache_activemq_
> artemis_api_core_management_QueueControl.html-23resetMessageCounter-2D-2D-
> 2522resetMessageCounter-28-29&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIr
> MUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=
> gkYvDx8RnaT70E66rKs5Jo0OkjeMVwp9CiHP_MPUCDI&s=
> 9whYnHNIAmfwgvYeuoC9Fl04FVLqiytMuwsvYGS9z1Y&e= API. Does this reset all
> the queue counters to 0? Also, does it set a reset time, which we can
> leverage further? If yes, which field would signify that?
>
> 2.       How can we determine the number of messages added/enqueued to a
> queue since the last reset time?
>
> 3.       How do we determine  the number of messages consumed/dequeued
> from a queue since the last reset time?
>
> 4.       For 2 above, I do see a getMessagesAdded() API which states that
> this returns the number of messages added to the queue since it was
> created. If the queue message counters are reset, would this API still
> return number of messages added since the queue was created or since the
> last reset?
>
> 5.       Is there an API to get the high queue depth or the maximum number
> of messages in a queue since the last reset time?
>
> 6.       If there are no APIs that answer 2, 3, 4 and 5 above, can we
> somehow derive or calculate these values from an API that Artemis provides
> today?
>
>
>
> Would appreciate if someone can clarify these.
>
>
>
>
>
> Thanks
>
> Neha
>
> Oracle Marketing Cloud
>
>
>

RE: Questions on queue message counters

Posted by Neha Sareen <ne...@oracle.com>.
Iterating point 1 again,( not sure how this was converted to a Hyperlink)

1. Trying to understand the resetMessageCounter() API. Does this reset all the queue counters to 0? Also, does it set a reset time, which we can leverage further? If yes, which field would signify that?

Thanks
Neha

-----Original Message-----
From: Neha Sareen 
Sent: Monday, June 25, 2018 10:38 AM
To: users@activemq.apache.org
Subject: Questions on queue message counters

Hi,

 

We are working with Apache Artemis 2.4.0 and have some questions related to the queue message counters.

 

I have been looking at the org.apache.activemq.artemis.api.core.management.QueueControl interface to get info around the queue message counter related APIs.

 

1.       Trying to understand the HYPERLINK "https://urldefense.proofpoint.com/v2/url?u=https-3A__activemq.apache.org_artemis_docs_javadocs_javadoc-2Dlatest_org_apache_activemq_artemis_api_core_management_QueueControl.html-23resetMessageCounter-2D-2D-2522resetMessageCounter-28-29&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=gkYvDx8RnaT70E66rKs5Jo0OkjeMVwp9CiHP_MPUCDI&s=9whYnHNIAmfwgvYeuoC9Fl04FVLqiytMuwsvYGS9z1Y&e= API. Does this reset all the queue counters to 0? Also, does it set a reset time, which we can leverage further? If yes, which field would signify that?

2.       How can we determine the number of messages added/enqueued to a queue since the last reset time?

3.       How do we determine  the number of messages consumed/dequeued from a queue since the last reset time?

4.       For 2 above, I do see a getMessagesAdded() API which states that this returns the number of messages added to the queue since it was created. If the queue message counters are reset, would this API still return number of messages added since the queue was created or since the last reset?

5.       Is there an API to get the high queue depth or the maximum number of messages in a queue since the last reset time?

6.       If there are no APIs that answer 2, 3, 4 and 5 above, can we somehow derive or calculate these values from an API that Artemis provides today?

 

Would appreciate if someone can clarify these.

 

 

Thanks

Neha

Oracle Marketing Cloud