7

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?

Nobo
  • 71
  • 1
  • 2

1 Answers1

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

I. Kozlovic
  • 796
  • 3
  • 3
  • Thanks for the monitoring advice, but you know this displays only the number of subscriptions not the subjects list – Montaro Jul 10 '18 at 17:08
  • @Montaro havent tested it myself but I can see `names` array down there. I think those are the names of channels – Sepehr GH Nov 08 '18 at 08:09