Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get list of subjects in NATS streaming server

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?

like image 869
Nobo Avatar asked Jun 08 '17 00:06

Nobo


1 Answers

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

like image 63
I. Kozlovic Avatar answered Oct 05 '22 03:10

I. Kozlovic