> Do you have any alternatives/proposal to retrieve this information? I believe I provided possible alternatives in my previous email on your other thread. I recommend you follow-up there if you have additional questions.
If there are additional metrics which aren't currently provided please open a JIRA with a clear explanation of what you want. Also, feel free to send a PR for any additional metrics. This is open source after all, and all contributions are welcome! Justin On Tue, Jun 26, 2018 at 2:12 PM, Neha Sareen <neha.sar...@oracle.com> wrote: > Thanks for the response Justin. > > > How can we run or test out the example against our broker set up to > > see > the result of Queue Message counter related APIs as we need these for our > development work further. > > I'm not exactly sure what you're asking here. If you want to run the > example against your broker simply run 'mvn verify -PnoServer' and ensure > the connection factory URL in jndi.properties as well as the JMX URL in > MessageCounterExample.java both point to your broker. If that's not what > you want please clarify. > > Neha: Essentially we have a Java application (client side) from where we > are trying to retrieve specific queue counters. Since the artemis brokers > and queues would be provisioned on a different host, we are trying to use > the Jolokia API to get the different queue message counters via a > HttpClient agent, wherein we bundle a HTTP request and execute it to get a > response. > Our requirement is to get the following pieces of information for a > destination (e.g. a queue): > > 1. Time since the last reset of queue counters > 2. Number of messages enqueued/added to the queue since last reset time. > 3. Number of messages dequeued/consumed from the queue since last reset > time > 4. High queue depth or maximum number of messages in a queue since the > last reset time. > 5. Current queue depth. > > From your response to one of my earlier emails, I do not see Artemis > providing us the support to get these attributes, except the last one, i.e > the current queue depth. > Do you have any alternatives/proposal to retrieve this information? > > Thanks > Neha > > > -----Original Message----- > From: Justin Bertram <jbert...@apache.org> > Sent: Tuesday, June 26, 2018 11:57 AM > To: users@activemq.apache.org > Subject: Re: Info required for MessageCounterInfo class > > > The response just indicates the counters as -1, -1, -1, > ...............and it is very hard to interpret this output, given that it > does not reflect what each counter signifies. Can someone point towards the > description or syntax of this output JSON? > > You'll notice that there are 24 entries in the "counters" array. Each > entry represents the number of messages added to the queue during that hour > of the day where the day is specified by the "date". You can use the > org.apache.activemq.artemis.api.core.management.DayCounterInfo object to > deserialize the JSON to Java. > > > The example makes use of > > org.apache.activemq.artemis.api.core.management.MessageCounterInfo > class that I do not see available in artemis-jms-client-all-2.4.0.jar. > > That class is currently in the org.apache.activemq:artemis-server Maven > module (lib/artemis-server-2.4.0.jar). I'll get it moved to > org.apache.activemq:artemis-core-client so it will be included in the > "all" > client jar in future releases. > > > How can we run or test out the example against our broker set up to > > see > the result of Queue Message counter related APIs as we need these for our > development work further. > > I'm not exactly sure what you're asking here. If you want to run the > example against your broker simply run 'mvn verify -PnoServer' and ensure > the connection factory URL in jndi.properties as well as the JMX URL in > MessageCounterExample.java both point to your broker. If that's not what > you want please clarify. > > > Justin > > > On Mon, Jun 25, 2018 at 6:24 PM, Neha Sareen <neha.sar...@oracle.com> > wrote: > > > Hi, > > > > > > > > We are working with Apache Artemis 2.4.0 and trying to determine the > > Queue Message Counters. > > > > > > > > 1. Invoking the Jolokia API to display MessageCounterHistory: > > > > $ curl -u artemis:artemis -H "Content-Type: application/json" -X POST > > -d '{"type":"exec", "mbean":"o > > > > > > rg.apache.activemq.artemis:broker=\"RI_BRKR\",component= > > addresses,address=\"BulkSend0.001.01.01\",su > > > > > > bcomponent=queues,routing-type=\"anycast\",queue=\" > > BulkSend0.001.01.01\"","operation":"listMessageCo > > > > > > unterHistory"}' > > 'https://urldefense.proofpoint.com/v2/url?u=http-3A__127.0.0.1-3A8128_ > > console_jolokia&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE > > &r=a9YS1Z_IlHjjwrEIkK3pngi5xaGRZ0QdCmbyVuaLSBU&m=k3dXw8UeMdYrYXrR0tA-_ > > ftx96vUxDKoj27AJZ3QqXE&s=STzKr8-O-ohzJh0DdxCn0BmQauOjJ9bhoycBGds21c4&e > > =' && echo > > > > > > > > {"request":{"mbean":"org.apache.activemq.artemis: > > address=\"BulkSend0.001.01.01\",broker=\"RI_BRKR\", > > > > > > component=addresses,queue=\"BulkSend0.001.01.01\",routing- > > type=\"anycast\",subcomponent=queues","typ > > > > > > e":"exec","operation":"listMessageCounterHistory"}," > > value":"{\"dayCounters\":[{\"date\":\"6\/25\/18\ > > > > > > ",\"counters\":[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,- > > 1,-1,-1,-1,-1,-1,-1,-1,-1,-1]}]}","timesta > > > > > > mp":1529960031,"status":200} > > > > > > > > The response just indicates the counters as -1, -1, -1, > > ...............and it is very hard to interpret this output, given > > that it does not reflect what each counter signifies. Can someone > > point towards the description or syntax of this output JSON? > > > > All I see in the the API doc for > > QueueControl.listMessageCounterHostory() > > is that it lists the message counter history for this queue. > > > > > > > > 2. Also tried to interpret and run the message-counters example > that > > comes with Artemis 2.4.0 (/apache-artemis-2.4.0/ > > examples/features/standard/message-counters/src/main/ > > java/org/apache/activemq/artemis/jms/example/ > MessageCounterExample.java). > > The example makes use of > > org.apache.activemq.artemis.api.core.management.MessageCounterInfo > > class that I do not see available in artemis-jms-client-all-2.4.0.jar. > > How can we run or test out the example against our broker set up to > > see the result of Queue Message counter related APIs as we need these > > for our development work further. > > > > > > > > Thanks > > > > Neha > > > > Oracle Marketing Cloud > > > > > > >