NATS guide: understanding delivery differences between Core NATS and JetStream
NATS is a distributed messaging system that routes messages by subject. Core NATS delivers a message at most once to clients currently connected and subscribed to that subject; it does not store or replay messages. If subscribers must receive messages while disconnected, use JetStream to store them in a stream and design consumer acknowledgements, redelivery, and read positions.
NATS is a distributed messaging system that routes messages by subject. Core NATS delivers a message at most once to clients currently connected and subscribed to that subject; it does not store or replay messages. If subscribers must receive messages while disconnected, use JetStream to store them in a stream and design consumer acknowledgements, redelivery, and read positions.
Choose the delivery model first
| Need | NATS setup | Meaning and limit |
|---|---|---|
| Live state or cache invalidation where a later message replaces a missed one | Ordinary Core NATS subscription | Only active subscribers receive it; at-most-once, without acknowledgement or storage |
| One worker among subscribers to a subject handles each task | Core NATS queue group | Shares load with one group member, but Core NATS does not redeliver after failure |
| Store messages while a subscriber is offline and read them later | JetStream stream and consumer | Storage/retention, consumer position, ACK, and redelivery settings determine behavior |
| Several business subscribers process the same event independently | Separate JetStream consumers on one stream | Each consumer has its own progress position and can replay within retention |
Avoid saying simply that “NATS guarantees messages.” Fast Core NATS and persistent JetStream offer different delivery contracts. A normal Core NATS subscription or queue group cannot recover a message missed during a disconnect when the business process requires it.
Core NATS subject subscriptions and queue groups
In Core NATS, a publisher sends a message to a subject such as orders.created. Each active subscriber interested in that subject receives its own copy. Publishers need not know subscribers, and subscribers need not know publishers. But if no subscriber is present or connected at that moment, the server does not store the message for later.
To divide work instead of giving every subscriber a copy, multiple subscribers use the same queue-group name on the same subject. The server selects one group member for each message. This does not change Core NATS’s at-most-once delivery: if the selected member exits while processing, another member does not automatically receive the message. If task loss is unacceptable, consider JetStream durable consumers and acknowledgement policies.
JetStream adds storage and reading across time
In JetStream, a stream is a server-side store for messages matching subjects, assigned sequence numbers. Storage (memory or disk), retention, replication, and other behavior are configurable. A consumer keeps server-side read state for a stream, tracking progress. Several consumers can read one stream independently; multiple clients can also share a consumer to divide work.
If a consumer does not acknowledge a delivery, the server may send it again after the configured acknowledgement wait. Thus at-least-once JetStream flows must handle duplicates safely. Storage does not mean indefinite retention: the stream’s limits, interest, or work-queue retention policy and capacity limits affect deletion and replay range. Choose whether a consumer starts at the beginning, latest position, or a specific time or sequence.
Before implementation
**Assess the cost of a missed message.** Distinguish replaceable live state from business events, such as orders or payments, that must be processed.
**Define what a subscriber means.** Decide whether each service needs a copy or one worker in a group should handle a task. Do not treat NATS queue groups and shared JetStream consumers as identical features.
**Design subject boundaries.** Represent service, event, and tenant scopes without overly broad subscriptions that deliver unnecessary messages.
**Set JetStream retention and positions.** Choose storage, retention policy and limits, replication, durable-consumer use, and starting position; consider the impact of changing or deleting them.
**Design acknowledgements and recovery.** Align consumer ACK policy and wait, redelivery limits/failure isolation, and message-ID-based idempotency with the business transaction.
**Plan observability and failure checks.** Monitor active subscribers, stream capacity and oldest message, and consumer pending/redelivery/ACK progress. Test the intended behavior by disconnecting a subscriber during publication or delaying a consumer ACK.
Do not assume operational retention or recovery from examples before checking the actual server version, JetStream activation, stream, and consumer settings. These are design checks, not tests claimed to have been run against a server.
Sources and scope
NATS, [Publish-Subscribe](https://docs.nats.io/concepts/pub-sub-basics)
NATS, [JetStream](https://docs.nats.io/concepts/jetstream)
NATS, [Queue groups](https://docs.nats.io/learn/core-nats/queue-groups)
This guide reflects the official documentation read on 2026-11-19. Core NATS and JetStream guarantees, retention, and replay are not interchangeable. Verify operational settings against the deployed server/client version and stream/consumer configuration.