HTTP API : get topics of the cluster

157 views
Skip to first unread message

Pierre Kolle

unread,
May 14, 2021, 12:50:20 PM5/14/21
to vernemq-users
Hello,

While I'm waiting for you help on my question of clustering, I'm searching to a way to get all the topics of the cluster with the HTTP API.

I tried lots of things, I can do it with sudo vmq-admin session show --topic but I don't know how to translate that to request because in the documentation, it's written how to translate --topic to &--topic, but there is no way if we don't have any ?arg=value before ?

Thanks 😊 

André Fatton

unread,
May 14, 2021, 1:47:52 PM5/14/21
to vernemq-users
Hi,

curl "http://9buDgk5xdz746CgIUD4YWmMvawMYz2@localhost:8888/api/v1/session/show?--topic"
curl "http://9buDgk5xdz746CgIUD4YWmMvawMYz2@localhost:8888/api/v1/session/show?--topic&--client_id"
Hope the examples help,
A.

Pierre Kolle

unread,
May 14, 2021, 5:28:34 PM5/14/21
to André Fatton, vernemq-users
Thanks a lot ! I will test that :-)
--
You received this message because you are subscribed to the Google Groups "vernemq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vernemq-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vernemq-users/c9b9fba0-09ee-4e97-b149-6e8933ea8bafn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pierre Kolle

unread,
May 15, 2021, 5:59:34 AM5/15/21
to vernemq-users

Can you say me why I don't see all the topics ?Capture d’écran 2021-05-15 à 11.59.13.png

André Fatton

unread,
May 15, 2021, 9:23:50 AM5/15/21
to vernemq-users
Hi,
Note that the "vmq-admin session show" command is a "session" show command, not a "topic" show command.
That is, it shows the topic filters for sessions (subscriptions).

With a lot of sessions you might need to increase 'limit' and 'rowtimeout' for the query language behind vmq-admin. Check "vmq-admin session show --help" for details.
Hope this helps,
A.

Pierre Kolle

unread,
May 15, 2021, 9:25:00 AM5/15/21
to André Fatton, vernemq-users
There is no way to get all the topics of the broker ?

Thanks 😊 
e2a02adc-1413-420e-8a31-1543c6a9d028.png

André Fatton

unread,
May 15, 2021, 9:33:28 AM5/15/21
to vernemq-users
Well, the session show command still gives you all the subscriptions, if you page through it.

Make sure you don't have a misunderstanding what a topic filter is. Topic names for incoming messages are routing keys. They do not exist in the broker, they are used by the routing layer to match against subscriptions.
Best,
A.

Pierre Kolle

unread,
May 15, 2021, 9:35:42 AM5/15/21
to André Fatton, vernemq-users
Thanks for this precision 😉  I was thinking there could be a way to list all the topics used in case in which the broker could store it, but I realize that’s not possible :p 

Thanks !
Reply all
Reply to author
Forward
0 new messages