Get list of subjects in NATS streaming server
Asked Answered
S

1

9

I'm looking for a way to display all the subjects that currently exist on a NATS Streaming Server during operation. Have thoroughly looked through documentation but have been unable to find a mention of this so far.

Is there a way to find a list of all available subjects that can be subscribed to on the server?

Servile answered 8/6, 2017 at 0:29 Comment(0)
D
9

I have just merged a PR that adds Monitoring to the NATS Streaming server. If you start the server with a monitoring port, say -m 8222, then you can get the list of channels by pointing to http://localhost:8222/streaming/channelsz

This would return:

{
  "cluster_id": "test-cluster",
  "server_id": "d1dzRa72OpjGRROXKJtfSV",
  "now": "2017-06-08T18:14:54.206006151+02:00",
  "offset": 0,
  "limit": 1024,
  "count": 2,
  "total": 2,
  "names": [
    "bar",
    "foo"
  ]
}

For more information, checkout https://github.com/nats-io/nats-streaming-server#monitoring

Dutybound answered 8/6, 2017 at 16:16 Comment(2)
Thanks for the monitoring advice, but you know this displays only the number of subscriptions not the subjects listAciculate
@Aciculate havent tested it myself but I can see names array down there. I think those are the names of channelsJanka

© 2022 - 2024 — McMap. All rights reserved.