This is a component for a NATS.io (v2.11.x) backend, customized with reasonable defaults to deliver notifications to AppShell-based frontends via messaging.
NATS.io is a high-performance messaging system designed to connect applications and data across diverse environments.
Some out-of-the-box features are:
- Message persistence via NATS.io streams
- KV store and Object store
- Optional exactly-once message delivery
- Messaging patterns: publisher-subscriber, request-reply...
For a more detailed overview about NATS.io, see: NATS Concepts - Overview
In order to deliver persistent notifications to an AppShell frontend, it is required configuring the NATS.io subjects and streams in the frontend to match the subjects and streams defined in the stream configurations.
See the HOWTO - Customization section for more details.
To administer the NATS.io backend server, some CLI tools are provided out-of-the box when deploying this backend on an OpenShift cluster.
These tools are available on a nats-box OpenShift container, running along the nats container, both on the same OpenShift Pod workload.
Take a look at the official documentation for details:
A watchdog script will automatically create persistent streams, one for each *-stream-config.json file section on the helm template file nats-box-config-map.yaml.
To customize the existing streams, on the nats-box-config-map.yaml helm template file, edit the xxx-stream-config.json properties to your needs.
To add new streams, just add more xxx-stream-config.json properties to the nats-box-config-map.yaml helm template.
NOTE: The matching AppShell-based frontend may require being configured accordingly.
After a successful Openshift nats backend deployment, on the nats-box container:
- For every
xxx-stream-config.jsonproperty, a stream json config file will be created automatically. - For every config file matching the pattern:
*-stream-config.json, a stream will be created on thenats server - The name of the stream will be inferred from the config filename, e.g.
my-stream-config.json -> my-stream - The presence of these streams will be checked periodically, recreating them automatically if missing.
These tasks are executed periodically by a streams-watchdog.sh script, also present on the nats-box-config-map.yaml helm template.
In order to schedule periodic tasks, e.g. purge old data periodically, an easy way would be customizing the streams-watchdog.sh script on the nats-box-config-map.yaml helm template.