nats demo running in a local kubernetes cluster.
Prerequisites:
- k3d (for creating a local kubernetes cluster)
- kubectl
- helm
Install nats cli, create k3d cluster and deploy nats:
make install
Endpoints:
- nats: tcp://localhost:4222
- nats monitor: http://localhost:8222
Run
make ping
make demo-js
python jetstream demonats stream ls
list streamsnats server report connections
list connectionsnats server ls --context=admin
list servers using system account (admin)nats server report jetstream --context=admin
jetstream summary reportnats kv watch articles
tail bucketdwatch
nats stream view KV_dwatch
view messages in theKV_dwatch
streamnats stream get KV_dwatch 2
view message with sid 2 inKV_dwatch
streamnats consumer rm KV_dwatch
delete consumer. Recreating it will start from the beginning of the stream.nats events -a
listen for advisories eg: delivery attempts exceeded
Stored in /etc/nats-config/nats.conf.
NB: /etc/nats/nats-server.conf is the default example config built into the docker image.
nats: error: server request failed, ensure the account used has system privileges and appropriate permissions
Connect using the system account.
Use the username and password when connecting, eg: