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
Maybe this is not what you are looking for on a cluster (but could be).
Nevermind, in case of a single NATS instance, using the CLI-tools:
Start with a PING
nats --server Host:Port rtt
General access:
nats --user username --password mypassword --server Host:Port
Listing the streams:
nats --user username --password mypassword --server Host:Port stream ls
Subscribing (a shell) onto a streams:
nats --user username --password mypassword --server Host:Port subscribe SUBJECT.STREAM
Publish a "JSON message" onto a stream:
cat <PathToMessage.json> | nats --user username --password mypassword --server Host:Port publish SUBJECT.STREAM --force-stdin
Show all messages published onto a Stream:
nats --user username --password mypassword --server Host:Port stream view
Additionally: Sample JSON Message:
{
"id": "4152c2e7-f2be-42d8-86fe-5b94f2ed3678",
"form": "triangle",
"wrappedData": {
"Color": "green",
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With