What is the inbox pattern, and how does it complement the outbox pattern for reliable message processing?
Last updated
The inbox pattern records each incoming message ID in an inbox table in the same DB transaction as the business work. Duplicates are detected and skipped.
It complements the outbox pattern: outbox ensures the producer never loses a message (at-least-once). Inbox ensures the consumer never processes it twice, giving effectively-once end to end.
Old inbox entries should be pruned periodically to keep the table bounded.
- https://bool.dev/blog/detail/part-9-microservices-dotnet-interview-questions
- https://dev.to/igornosatov_15/the-outbox-pattern-a-love-letter-to-eventual-consistency-3ch3
- https://blog.devgenius.io/inbox-outbox-pattern-building-reliable-systems-in-distributed-architectures-912a3246c4c4
- https://www.youtube.com/watch?v=vS9_WsNwLlo