Out of the box, does NATS / JetStreams guarantee message delivery?

76 Views Asked by At

We are using NATS with JetStreams. Logs suggest that messages are intermittently dropped. My expectation is that JetStreams would guarantee delivery.

Out of the box, does NATS / JetStreams guarantee message delivery?

If not, are there special coding requirements -- either in the producer, consumer, or both -- that would ensure this behavior?

1

There are 1 best solutions below

0
mtmk On

NATS JetStream has at-least-once delivery guarantee by default, meaning you'd have to do a bit more to avoid duplicate message publishing but once you get an ACK from the server it means that your message is persisted.

In your case first thing is to check your publishing. You should use JetStream publish if you want delivery ACKs. Another thing to watch out for is your stream and consumer configs. Limits and retention policies would affect you message durability: https://docs.nats.io/nats-concepts/jetstream