How to enable RabbitMQ persistence?
1
2
3
The below steps enable RabbitMQ persistence.
- Set the “durable” property to true in the exchange’s parameters to survive server restarts.
- Also, set the “durable” property to true in the queue’s parameters to survive server restarts.
Finally, set the “persistent” header in the messages to true when using the RabbitMQ dashboard UI or CLI.
OR set the “delivery_mode” header in the messages to 2 when sending messages from code.