8000 GitHub - andy-g/nats-playground: Playground for a secure, Highly Available NATS Cluster with message persistence (using JetStream)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Playground for a secure, Highly Available NATS Cluster with message persistence (using JetStream)

License

Notifications You must be signed in to change notification settings

andy-g/nats-playground

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NATS JetStream Playground

Playground for a Secure, Highly Available NATS Cluster with message persistence (using JetStream).

This repo contains a cluster with 3 nodes and a Go client sending/receiving messages to it.

Pre-requisites

To use this repo, please install:

  • Docker
  • mkcert (zero-config tool for locally-trusted development certificates)

Installation

Authentication for client-server and server-server (for the cluster) use X509 certificatesn. To install them locally:

make certificates

Run it

Spin up the cluster with:

docker-compose up

Run the client with:

cd client
go run client.go

You should see the following appear in your terminal:

connecting securely to cluster
getting JetStream context
stream not found
creating stream "ORDERS" and subject "ORDERS.received"
publishing an order
attempting to receive order
got order: "one big burger"

You can also use nats-io/nats-tools/nats to issue manual commands to the cluster. If you do so, you may need to change the client publish permissions in config/jetstream.conf.

Clean up

Once you are done testing, remove the CA from your local system trust store:

make cleanup

About

Playground for a secure, Highly Available NATS Cluster with message persistence (using JetStream)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 80.1%
  • Makefile 19.9%
0