Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does rabbitmq delete messages from physical storage

I have durable exchanges and queues in my application. The messages are persistent too. Using this configuration i am sure my messages gets stored in physical storage. I want to know if there is any expiry time when rabbitmq delete messages from my physical storage i mean the hard disk as it maintains the message store in it. Also in case i want to read the messages from physical storage then can i do so?

like image 824
Aditya Ekbote Avatar asked Feb 04 '26 07:02

Aditya Ekbote


1 Answers

Durable queue + Persistent messages means indeed the messages will be kept. Exceptions to this statement out of the top of my head:

  • you would have configured additional properties to your queues, for exemple limits in size
  • you reach the limit to the underlying filesystem
  • you delete the queues (this would delete the messages stored in it too)

As to reading the messages stored in the queues, you can typically consume them.

If you want to read them without them being deleted, you'd have few options:

  • trick the broker (for example by reading all of them but never acknowledging them, which would have them brought back into the queue)
  • republish them again to the broker for storage after reading them

But if indeed further conservation is desired, I'd seriously consider storing them somewhere else (DB of some kind) at it's clearly outside of the purpose of a message broker.

like image 192
Olivier Avatar answered Feb 05 '26 23:02

Olivier



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!