Connect to NATS
You need the streamview program, Node.js, and the address of a NATS server.
Show all subjects
Section titled “Show all subjects”Run this command with the address of your server:
streamview nats --servers localhost:4222The first time, the command installs the NATS adapter. This takes some seconds. The browser then opens, and each subject is one lane.
- For subjects that a JetStream stream stores, you see the history.
- For all other subjects, you see only the messages that come after streamview starts.
Show only some subjects
Section titled “Show only some subjects”Add --subjects, with a comma between the subjects. You can use the * and > wildcards.
streamview nats --servers localhost:4222 --subjects 'orders.>,payments.*'Make one lane from subjects that contain IDs
Section titled “Make one lane from subjects that contain IDs”If your subjects contain IDs, there are too many lanes.
Add --depth with the number of subject parts that make one lane.
streamview nats --servers localhost:4222 --depth 2With --depth 2, telemetry.courier.7 and telemetry.courier.8 are one lane, telemetry.courier.
The full subject stays in the subject field of each event.
Show only new messages from streams
Section titled “Show only new messages from streams”Add --latest. streamview then does not read the history of the streams.
To ignore JetStream fully, add --no-jetstream. streamview then subscribes to all subjects.
Connect the messages of one order
Section titled “Connect the messages of one order”Add --correlation-field with the name of the field that all messages of one order contain.
streamview nats --servers localhost:4222 --correlation-field orderIdstreamview also reads the correlationid header, the Correlation-Id header, and the traceparent header of a message.
Give a name and a password
Section titled “Give a name and a password”Use one of these three options:
| The server needs | Add |
|---|---|
| A name and a password | --user NAME --password TEXT |
| A token | --token TEXT |
| A credentials file | --creds FILE |