1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00
2021-03-15 16:43:35 +00:00

823 B

NATS Admin CLI

nats Admin CLI

The nats CLI can be used to manage Streams and Consumers easily using it's --config flag, for example:

Add a new Stream

This creates a new Stream based on orders.json. The orders.json file can be extracted from an existing stream using nats stream info ORDERS -j | jq .config

$ nats str add ORDERS --config orders.json

Edit an existing Stream

This edits an existing stream ensuring it complies with the configuration in orders.json

$ nats str edit ORDERS --config orders.json

Add a New Consumer

This creates a new Consumer based on orders_new.json. The orders_new.json file can be extracted from an existing stream using nats con info ORDERS NEW -j | jq .config

$ nats con add ORDERS NEW --config orders_new.json