Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
/ nats-box Public archive
forked from nats-io/nats-box

A container with NATS utilities

License

Notifications You must be signed in to change notification settings

magneticio/nats-box

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

_ __   __ _| |_ ___      | |__   _____  __
| '_ \ / _` | __/ __|_____| '_ \ / _ \ \/ /
| | | | (_| | |_\__ \_____| |_) | (_) >  < 
|_| |_|\__,_|\__|___/     |_.__/ \___/_/\_\                                           

License Version

nats-box

A lightweight container with NATS and NATS Streaming utilities.

  • nats-pub - publish NATS messages
  • nats-req - send a request, receive a response over NATS
  • nats-sub - subscribe to NATS messages on a topic
  • stan-pub - publish messages to NATS Streaming
  • stan-sub - subscribe to messages from NATS Streaming
  • nats-top - top-like tool for monitoring NATS servers
  • nsc - create NATS accounts and users

Getting started

Use tools to interact with NATS.

$ docker run --rm -it synadia/nats-box:latest
~ # nats-pub -s demo.nats.io test 'Hello World'
Published [test] : 'Hello World'

Running in Kubernetes:

kubectl run -i --rm --tty nats-box --image=synadia/nats-box --restart=Never
nats-box:~# nats-sub -s nats hello &
nats-box:~# nats-pub -s nats hello world 

Using NSC to manage NATS v2 users and accounts

You can mount a local volume to get nsc accounts, nkeys, and other config back on the host.

$ docker run --rm -it -v $(pwd)/nsc:/nsc synadia/nats-box:latest

# In case NSC not initialized already:
nats-box:~# nsc init -d /nsc
$ tree -L 2 nsc/
nsc/
├── accounts
│   ├── nats
│   └── nsc.json
└── nkeys
    ├── creds
    └── keys

5 directories, 1 file

Packages

No packages published

Languages

  • Go 73.8%
  • Shell 16.5%
  • Dockerfile 9.7%