Retry and Dead-Letter Queues in NATS JetStream with Go
In the previous post we built a simple publisher and worker on JetStream. But that worker assumed processing always succeeds. In real systems some messages fail every single time, and if you do nothing they either retry forever or get lost. This post adds three things: Limiting attempts with MaxDeliver Spacing out attempts with BackOff and NakWithDelay Routing “poison” messages to a dead-letter stream I tested every behavior below against an embedded NATS server (with JetStream) and the nats.go client, and the outputs come from that run. ...