[rabbitmq-discuss] Backing up persisted messages

Tim Watson tim at rabbitmq.com
Thu Jan 30 18:34:18 GMT 2014

On 30 Jan 2014, at 17:58, Beth Jones wrote:
> Specifically I have a queue that is accumulating messages and I'm worried about those messages being deleted accidentally.  I want to be able to back up that queue on a regular basis (say daily or hourly) to a location on disk.  
> I read about copying the mnesia directory.  Does that copy all the data for all of the queue on that node?  Is there something similar that is queue specific?

The queue specific thing would be to cluster two or more RabbitMQ brokers and set a High Availability policy on the queue so that all its messages are replicated to the other node(s). If the primary node crashes, one of the replicas will take over and you won't loose any messages (that have already been written to disk). Take a look at http://www.rabbitmq.com/ha.html for more details.

If your network is potentially unreliable (i.e., network partitions are quite likely) then you might want to consider using a federated exchange instead. This will perform the replication for you (i.e., copy messages from the exchange to another node(s) as per your configuration/policy) and the receiving node will effectively have a backup of all the data sent to the original exchange. I'd go for HA if you've got a reliable network though, since for your use-case it is ideal.


More information about the rabbitmq-discuss mailing list