nats-js-setup

command module
v0.0.0-...-aec1c34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 9 Imported by: 0

README

Setup NATS Jetstream

The supported events are fired on their respective streams and consumers consume those events from the stream based on some filters. The streams and the consumers are present in the NATS cluster.
The streams must exist before the publishers publish events on those streams. To configure NATS Jetstream the given Dockerfile can be used to build an image on the top of natsio/natsbox (having tools to communicate with NATS), which contains a binary called setup-nats-js.

To build the image, being in this directory run

$ docker build . -t reactive-micro/setup-nats-js:latest

Once the reactive-micro/setup-nats-js:latest is built, run the following command to create streams and consumers in NATS JS

$ docker run --rm reactive-micro/setup-nats-js:latest /bin/sh

This will drop you inside the container, where setup-nats-js command in available.
consumer-configs/: contains configuration of all the consumers.
stream-configs/: contains configuration of all the streams.

$ setup-nats-js -nats-uri NATS_URL -streams-dir STREAM_CONFIG -consumers-dir CONSUMER_CONFIG

If you want to add new streams/consumers, add their config files in their respective folders, build the image again and run the above command to configure NATS JS.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL