Skip to content

sourabp/nats-streaming-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nats-streaming-cli

CLI for Nats streaming service.

The CLI can be used to publish messages and subscribe to messages from a nats streaming service cluster.

Get Started: Install the CLI

You can install the CLI via go modules or pull a docker image.

GO Module

go install github.com/sourabp/nats-streaming-cli

Docker pull

docker pull sourabp/nats-streaming-cli

Run the CLI

The main commands supported by the CLI are:

  • publish: publishes message to a channel
  • subscribe: subscribe to messages from a channel, terminates on SIGKILL or SIGTERM

Conection parameters

Default url of nats-streaming-service: localhost:4222 and cluster id: test-cluster

Publish

$ nats-streaming-cli publish -q "foo_channel" "Hello World"

// Publishing to non-default cluster
$ nats-streaming-cli publish -s "<nats_server_ip>" -p "<nats_server_port>" -c "prod_cluster" -q "foo_channel" "Hello World"

Subscribe

$ nats-streaming-cli subscribe -q "foo_channel"

// Add multiple subscribers to listen to a single queue group
$ nats-streaming-cli subscribe -q "foo_channel" --queue-group "baz_group" // consumer 1
$ nats-streaming-cli subscribe -q "foo_channel" --queue-group "baz_group" // consumer 2

About

CLI for Nats streaming service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages