osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Questions on queue message counters


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 <jbertram@xxxxxxxxxx> 
Sent: Tuesday, June 26, 2018 10:39 AM
To: users@xxxxxxxxxxxxxxxxxxx
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 <neha.sareen@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx
> 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
>
>
>