NATS JetStream, explained
JetStream is the persistence layer built into the NATS server. Core NATS delivers messages to whoever is listening right now; JetStream stores them so they can be replayed, acknowledged and delivered later.
CORE CONCEPTS
- Streams
- A stream captures every message published to its configured subjects (wildcards like
orders.>allowed) and stores it in memory or on disk, with limits by age, size or count. - Consumers
- A consumer is a view onto a stream that tracks what a client has read. Durable consumers remember their position across restarts; push consumers deliver to a subject, pull consumers fetch in batches.
- Acknowledgements
- Consumers can require each message to be acked. Unacked messages are redelivered, giving at-least-once delivery; with message de-duplication and double acks you can get exactly-once semantics.
- Replication
- In a clustered deployment a stream can keep up to 5 replicas, so data survives a server failure.
- Key-Value & Object Store
- Both are built on streams: a key-value bucket for configuration and state, an object store for larger files.
WHY MONITOR CONSUMER LAG
Lag is the number of stored messages a consumer hasn't processed yet. Rising lag means subscribers are falling behind publishers — the earliest sign of an overloaded or stuck service. Mission Control shows it live from the js.stream.lag subject.
EXPLORE JETSTREAM IN MISSION CONTROL
- Live Overview →See current JetStream stream lag next to hemisphere and radio health.
- Subject Explorer →Browse the subjects flowing through the bus — the same subjects streams capture.
- Console →Publish and subscribe to subjects live over WebSocket.
- Telemetry →Message rates and throughput charts over time.
- Topology →How agents and services connect across the network.
- MCP Integrations →Let AI agents query JetStream message history with the query_messages tool.
Further reading: the official NATS JetStream documentation.