Losing messages can be avoided by following the best practices in this section. For the most part, CC has followed the best practice of keeping queues short and efficient. Queues that contain too many messages have a negative impact on the broker's performance. An identified high RAM usage could indicate that the number of queued messages rapidly went up.
Here are some best practice recommendations for how to not lose messages in RabbitMQ:
- Use at least three nodes in the RabbitMQ cluster, and the quorum queue type to spread messages to different nodes.
- If it is absolutely imperative that all messages are processed, declare a queue as durable and set the message delivery mode to persistent, as described in Chapter 2, Creating a Taxi Application. Queues, exchanges, and messages need to be able to handle any restarts, crashes, or hardware failures that may occur.
Here are some clarifications regarding message handling in RabbitMQ:
- Understanding the trade...