在 RabbitMQ 中确保消息可靠性(不丢失消息)涉及持久队列、持久消息、确认机制和发布者确认。理解这些机制对于构建能够在失败后生存的可靠消息传递系统很重要。
可靠性的各个层级
To ensure messages aren't lost, address each point of potential loss:
1. PUBLISHING → did the message reach the broker?
2. STORAGE → does the message survive a broker restart/crash?
3. CONSUMPTION → is the message processed before being removed?
→ reliability requires handling ALL three
