In this lesson · topic 7 of 7
Topic 7
Duplicates, timeouts and exactly once: three checks
4 min read
Predict first
Predict first
Predict first
Take away
- Ack first loses messages on a crash. Ack last repeats them. The broker cannot tell which crash happened.
- A slow consumer causes repeats as surely as a dead one. Treat redelivery as routine.
- Exactly once is end to end: at-least-once delivery, plus an effect that is safe to repeat.
- An idempotency key works only when it commits in the same transaction as the effect, and when it outlives any possible redelivery.
Sources
- J. H. Saltzer, D. P. Reed and D. D. Clark, End-to-end arguments in system design, ACM Transactions on Computer Systems, 1984.
- Jay Kreps, Neha Narkhede and Jun Rao, Kafka: a distributed messaging system for log processing, NetDB, 2011.
- Tyler Akidau and others, MillWheel: fault-tolerant stream processing at internet scale, Proceedings of the VLDB Endowment, 2013.
- Martin Kleppmann, Designing Data-Intensive Applications, O’Reilly, 2017.
- RabbitMQ documentation, Consumer acknowledgements and publisher confirms.