Skip to content

NATS is a messaging system for services, edge deployments, and cloud-native applications. Tenzir integrates with NATS JetStream to consume messages from subjects and publish events back to subjects.

Use from_nats to consume JetStream messages and to_nats to publish messages.

from_nats "alerts", durable="tenzir-alerts"
this = string(message).parse_json()

The NATS server must have a JetStream stream that captures the subject you consume from.

subscribe "alerts"
to_nats "alerts"

By default, to_nats serializes each event with this.print_ndjson().

from_nats "alerts",
url="tls://nats.example.com:4222",
auth={token: secret("NATS_TOKEN")},
tls={}
this = string(message).parse_json()

Last updated: