Simple NATS client that allows to publish and make requests
Natsy supports both command line flags and configuration file (flags override file configuration).
--message string nats message
--request nats request
--subject string nats subject
--timeout duration nats timeout (request only) (default 1s)
--url string nats url
./natsy --url "demo.nats.io" --subject "foo" --message "Hello, world." --timeout 500ms
demo.nats.io - foo > Hello, world.
demo.nats.io - foo < published
natsy
can be used to make request also if the --request
flag is provided:
./natsy --url "demo.nats.io" --subject "foo" --message "Hello, world." --request
Example output:
demo.nats.io - foo > Hello, world.
demo.nats.io - foo < demo.nats.io - foo < err: nats: timeout
Natsy looks for a configuration file called config.yaml
in the same directory it is executed.
config.yaml
url: demo.nats.io
subject: foo
message: "Hello, world."
timeout: 500ms
request: false
./natsy
demo.nats.io - foo > Hello, world.
demo.nats.io - foo < published