nsc creates NATS operators, accounts, users, and manage their permissions.
nsc create operator -s # Die -s zorgt voor een GOEIE sys account met juiste
# rechten op streams.
nsc list operators
nsc list accounts
nsc list users
nsc env -o <operator>
nsc env -a <account>
nsc describe user -a other -n usr_other -R
nsc describe account --name other -R
nsc describe operator -R
note: Only users have creds.
nsc generate creds -i
nsc generate creds -a account -n username
nsc export keys -a # account
nsc export keys -o # operator
echo $NATS_CREDS
echo $NATS_URL
On the replying side:
nats reply reqrep "pong: {{.Request}}"
On the requesting side:
nats request reqrep hoi
nats stream view <stream>
A "Consumer" provides a stateful view on a stream. Eg. when there are 2 applications accessing a stream, each application can use a consumer to have their own independent view of available messages.
A pull consumer is used for applications to:
A push consumer is used to push message from one stream to another.