Back to docs
Recipe

NATS Primer

Connect Meridian to NATS for low-latency pub/sub messaging across your distributed services.

Overview

NATS is a lightweight, high-performance messaging system designed for cloud-native applications. Meridian integrates directly with NATS servers, enabling real-time event streaming, request-reply patterns, and durable queue groups without external brokers.

Connection String

Meridian accepts a standard NATS URL. TLS is enforced by default on port 4222.

nats://demo.nats.io:4222

Subjects & Wildcards

Subjects are dot-delimited strings. Meridian supports* (single token) and> (multi-token) wildcards for flexible routing.

  • orders.us.east — exact match
  • orders.*.east — any region
  • orders.> — all sub-hierarchy

JetStream Persistence

For at-least-once delivery, Meridian leverages JetStream streams and consumers. Define retention policies, max message age, and replay strategies directly in your Meridian config.

Quick Start

Run a local NATS server, then point Meridian at it. Messages flow instantly.

nats-server -js

Need deeper integration? Read the NATS reference for full configuration options.