Command line client for STAN messaging.
Donwload CLI executable for your OS from latest release assets.
Flag --pub
is used to publish message. Run following command in terminal, but with required STAN subject instead of here.is.some.subject
./stan --pub --subject=here.is.some.subject
after that type or paste your message body. Finally, to publish message hit Enter
/Return
and then Ctrl-D
to interrupt typing.
./stan --sub --subject=here.is.some.subject
To connect to specific Nats MQ, you need to specify configuration.
You can specify connection config using --url
and --cluster-id
flags. For expample:
./stan
--sub
--subject=here.is.some.subject
--url=nats://our-nats.dev.cloud:1234
--cluster-id=our-cluster
If you omit these flags, default values are used. Default values are nats://0.0.0.0:4222
for --url
and test-cluster
for cluster-id
.