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" {
read_json
}

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

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

Last updated: