Embedded NATS JetStream

Durable streams · Replay · Reliable delivery

Overview

1SEC is event-driven. The embedded NATS JetStream bus provides durable streams for events, alerts, responses, and (optionally) Rust match results.

Subjects

  • sec.events.> — canonical events
  • sec.alerts.> — alerts emitted by modules
  • sec.responses.> — enforcement audit trail
  • sec.matches.> — Rust engine matches (optional)

Durability

JetStream streams are configured with retention, max bytes, and durable consumers. This lets you restart the engine without losing in-flight events.

Embedded Mode

Embedded mode starts NATS in-process. You can also point 1SEC at an external NATS server.

Config snippet
bus:
  embedded: true
  url: "nats://127.0.0.1:4222"
  data_dir: "./data/nats"

Tuning

For very high volume deployments, tune stream limits and pair with the cold archive for long retention.