Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

488
Views
How to make RabbitMQ more reliable? Is it possible to have it backup its data (messages) periodically?

I want to ensure no will be lost in RabbitMQ if case it crashes. Is is possible to somehow have RabbitMQ dump or backup all the queues it has on disk?

I also have heard that once it receives a messages and even if it crashes, when it's up the message will be available.

So what do you recommend to make the process more reliable?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

In RabbitMQ, this can be achieved using the durability of the queues and messages. Queue durability means that its configuration will be stored on the disk. And when RabbitMQ recovers after a crash, the queue will be restored. It can be done thus :

channel.queue_declare(queue='myQueue', durable=True)

What you seek is more closely related to message durability. Publish all your messages with the delivery_mode flag set to 2. The default value is 1, which makes messages reside only in the RAM. See this for code samples in Python. Excerpt below.

channel.basic_publish(exchange='',
                  routing_key='task_queue',
                  body=message,
                  properties=pika.BasicProperties(
                     delivery_mode = 2, # make message persistent
                  ))

Please note that enabling message durability has its effects on performance. When set to 2, RabbitMQ broker has to do the additional work of writing messages to and reading them from the disk.

over 4 years ago · Santiago Trujillo Report

0

The best way is to create an RabbitMQ cluster and then configure the HA policies.

When you configure the HA, the messages are replicated to the other nodes. If one node crashes you can accessthe other node(s).

You can also backup the Mnesia directory that usually contains configuration and messages, but some messages can stay to the cache. To be sure you should stop the rabbitmq application.

I'd try using the HA.

Another way to backup continuously the messages is using Shovel plugin

As mentioned by @Milind using a persistent message is an best practise.

edit

You cloud use the Tx Transaction please read here: https://www.rabbitmq.com/blog/2011/02/10/introducing-publisher-confirms/

Tx can solve your problem, but can have a big impact to the performance.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!