You can navigate the Artemis web console, and in the list of 'Operations' you can use the three-dots menu to 'Copy Jolokia URL'. For an example the countMessages() method on the DQL can be called with: http://172.17.0.2:8161/console/jolokia/exec/org.apache.activemq.artemis:broker=!%22broker!%22,component=addresses,address=!%22DLQ!%22,subcomponent=queues,routing-type=!%22anycast!%22,queue=!%22DLQ!%22/countMessages()
curl -u '...@...' -H 'Origin: ...' 'http://.../console/jolokia/.../countMessages()' ``` { "request": { "mbean": "org.apache.activemq.artemis:address=\"DLQ\",broker=\"broker\",component=addresses,queue=\"DLQ\",routing-type=\"anycast\",subcomponent=queues", "type": "exec", "operation": "countMessages()" }, "value": 0, "timestamp": 1679588433, "status": 200 } ``` На чт, 23.03.2023 г. в 18:07 ч. Thai Le <lnthai2...@gmail.com> написа: > > Thank you for the reference, i checked them but still confused about how to > navigate between different Control classes. As i understand, this url > http://localhost:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\"0.0.0.0\"/QueueNames > mean to execute the getQueueNames method but how do I know that it is > executing on the ActiveMQServerControl class? The AddressControl class also > has the getQueueNames method. What if I want to see the message count in > queue Q of address A? I tried something like this: > http://localhost:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\"0.0.0.0\"/Address/A/Queue/Q/MessageCount > but it did not work. Also, is it possible to browse messages as web console > does? > > Thai Le > > On Thu, 23 Mar 2023 at 00:47, Domenico Francesco Bruscino < > bruscin...@gmail.com> wrote: > > > the partial list of the Management API MBeans is in the documentation[1], > > i.e. to list the addresses you can use the getQueueNames method of > > ActiveMQServerControl > > > > curl -v -H "Origin: http://localhost" -u admin:admin > > > > http://localhost:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\ > > "0.0.0.0\"/QueueNames > > > > To learn about all available management operations, see the Javadoc for > > these interfaces[2]. They are located in the > > org.apache.activemq.artemis.api.core.management package and they are named > > with the word Control at the end. > > > > [1] > > > > https://activemq.apache.org/components/artemis/documentation/latest/management.html#the-management-api > > [2] > > > > https://activemq.apache.org/components/artemis/documentation/javadocs/javadoc-latest/org/apache/activemq/artemis/api/core/management/package-summary.html > > > > On Wed, 22 Mar 2023 at 22:56, Thai Le <lnthai2...@gmail.com> wrote: > > > > > Hi again, > > > The example of the curl command to jolokia endpoint is fetching the > > Version > > > attribute of the org.apache.activemq.artemis:broker mbean, is there other > > > mbean like address, queue, message that i can query? > > > > > > On Sat, 11 Mar 2023 at 11:28, Thai Le <lnthai2...@gmail.com> wrote: > > > > > > > I was actually looking for the management API, thanks for pointing out > > > the > > > > differences. I'll look into jolokia endpoint. > > > > > > > > Thai Le > > > > > > > > On Sat, Mar 11, 2023, 10:28 Justin Bertram <jbert...@apache.org> > > wrote: > > > > > > > >> When you say "REST API" do you mean the REST *messaging* API or the > > > >> REST-like *management* API? > > > >> > > > >> We still have the REST-like management API [1] which you can use to > > get > > > >> data from the broker like queue message counts, browse messages, etc. > > > This > > > >> API is provided via the Jolokia JMX-HTTP bridge which allows you to > > > access > > > >> the broker's JMX MBeans via HTTP. > > > >> > > > >> > > > >> Justin > > > >> > > > >> [1] > > > >> > > > >> > > > > > https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia > > > >> > > > >> On Sat, Mar 11, 2023 at 8:53 AM Thai Le <lnthai2...@gmail.com> wrote: > > > >> > > > >> > Thank you for the detail explanation. I was looking for a quick way > > to > > > >> get > > > >> > info about queues (number of messages avail, peak some messages...) > > > for > > > >> > debugging purpose. I guess I just need to make an stand alone app > > and > > > >> use > > > >> > Java client to get those info. > > > >> > > > > >> > Thai Le > > > >> > > > > >> > On Fri, Mar 10, 2023, 12:57 Justin Bertram <jbert...@apache.org> > > > wrote: > > > >> > > > > >> > > As Robbie noted, the REST interface was removed in 2.26.0. You can > > > >> find > > > >> > the > > > >> > > original discussion regarding removal here [1]. > > > >> > > > > > >> > > As I understand it, here are the essential reasons for removing > > it: > > > >> > > - The dependencies had fallen woefully out-of-date and nobody was > > > >> > willing > > > >> > > to put in the effort to fix them since there were some breaking > > > >> changes > > > >> > > along the way. > > > >> > > - The STOMP protocol is ubiquitous, simple, standardized, and can > > > be > > > >> > used > > > >> > > in almost every circumstance and environment where REST might be > > > used. > > > >> > > - REST messaging is not portable because there's no standard > > > >> messaging > > > >> > API > > > >> > > for REST. This is generally bad for users as it locks them in to a > > > >> > specific > > > >> > > broker. > > > >> > > - For simple use-cases (e.g. basic send & receive) it's easy > > these > > > >> days > > > >> > to > > > >> > > create your own REST interface and then implement messaging behind > > > >> that. > > > >> > > Since the REST interface is in the user's control then portability > > > >> isn't > > > >> > an > > > >> > > issue. > > > >> > > - It's a bit of a pain to set up as it requires manually > > building a > > > >> WAR > > > >> > > file. This wasn't a great user experience and limited adoption. > > > >> > > > > > >> > > You are, of course, still free to use the REST interface WAR from > > > >> 2.25.0 > > > >> > > with any newer version. > > > >> > > > > > >> > > > > > >> > > Justin > > > >> > > > > > >> > > [1] > > > https://lists.apache.org/thread/qcdg5r1ytf0scr05b9wxyxg0stxgs5pp > > > >> > > > > > >> > > On Thu, Mar 9, 2023 at 4:53 PM Thai Le <lnthai2...@gmail.com> > > > wrote: > > > >> > > > > > >> > > > Hello, > > > >> > > > > > > >> > > > Does the REST API still exist in the latest version? I do not > > see > > > >> it in > > > >> > > the > > > >> > > > doc of 2.28. > > > >> > > > > > > >> > > > Regards > > > >> > > > > > > >> > > > Thai Le > > > >> > > > > > > >> > > > > > >> > > > > >> > > > > > > > > > > -- > > > Where there is will, there is a way > > > > > > > > -- > Where there is will, there is a way