From: http://www.rabbitmq.com/blog/2011/01/20/rabbitmq-backing-stores-databases-and-disks/
If Rabbit must save memory and write to disk, only one message is saved.
“The queues themselves decide when and whether to write a message to disk. But one message can be sent to several queues, and it is obviously beneficial to make sure that each message is only written to disk once. However, there are two different pieces of information here: - first, the content of the message itself. This is the same in each queue to which the message was sent, and should only be written to disk once, regardless of the number of queues it goes to, note that subsequent entries from this have to do equalization of values: if the message identifier is known to the backup storage, then the message body will correspond to what is already on the disk. The message content is never changed by the broker. The second part of the information is the presence of the message in each queue: where in the queue lies, what are its neighbors and What is his status in the queue? This second part of the information is what allows RabbitMQ to start, restore messages and queues from disk and ensure that the messages in each queue are in the same order as when disconnected RabbitMQ.
Thus, the default backup storage RabbitMQ consists of a node-global global message store, which only deals with writing the contents of a message to disk; and a queue queue index, which uses a completely different format for writing to a message for each data queue on disk "
source share