'Is there a way to view NATS messages?

I am trying to look at the messages in a NATS cluster on a certain topic. My google searches led to https://github.com/KualiCo/nats-streaming-console and https://hub.docker.com/r/fjudith/nats-streaming-console but neither npm install nor yarn install worked. I am not sure if thats an issue with the image or if thats my system setting.

And since I am new here, I wasn't allowed to comment. I have been running in circles for sometime with this so any pointers would be highly appreciated.

-Suresh



Solution 1:[1]

Use the nats CLI tool (https://github.com/nats-io/natscli/releases/):

To look at the messages being published on subject foo for example just use nats sub foo.

Note that NATS-Streaming (aka STAN) is now deprecated and replaced by JetStream which is built-in to the nats.io server.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JNM