Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

490
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda