1

If I use publisher confirms, I can be (reasonably) sure that a message sent to an exchange on the RabbitMQ server, and which received ACK from the RabbitMQ server is not lost even if the RabbitMQ server crashes (power outage for example).

However what happens when a message arrives at a dead letter exchange after a manual rejection in the consumer? (channel.basicReject, I use Spring AMQP.)

Can I still be sure that in the case in which the original message is dequeued from the queue to which the consumer is listening, and the RabbitMQ server subsequently crashes, I will eventually find the message, after the RabbitMQ server is restarted, in the queues which are bound to the dead letter exchange (if normally the message would have arrived there)?

If the answer is negative, is there a way to ensure that this is the case?

John Donn
  • 1,718
  • 2
  • 19
  • 45
  • Hi John, so in my last project, we had RabbitMQ with reject and going to dead letter. And from what we experienced, we never lost the messages. And we sued those queues to find problems with messages or reprocess. – Brother Jun 25 '19 at 09:36
  • Thank you for your comment; however since I know that RabbitMQ was created with a particular concern for concurrency, I would like to know whether there are guarantees for the case I describe (in the sense that this situation was taken into account; of course there are no guarantees if the OS gets damaged and the like). – John Donn Jun 25 '19 at 10:18
  • 1
    My best guess is it won't be removed from the primary queue until after it is written to the DLQ (if there is a route from the DLX), but will be discarded if there is no route to a queue from the DLX. However, you should ask questions about RabbitMQ internals on the `rabbitmq-users` Google group where the RabbitMQ engineers hang out; they don't monitor Stack Overflow as much. If you get an answer over there, I suggest you add it as an answer here. – Gary Russell Jun 25 '19 at 12:20

1 Answers1

1

As @GaryRussell suggested, I posted a similar question on rabbitmq-users Google group.

Here is the answer I got from Daniil Fedotov

"Hi,

There is no delivery guarantees in place. Dead lettering does not check if the message was enqueued or saved to disk.
Dead-lettering does not use publisher confirms or any other confirm mechanisms.

It's not that easy to implement reliable dead-lettering from one queue to another and there are plans to address this issue eventually, but it may take a while.

If you want to safely reject messages from the consumer without a risk of losing them - you can publish them from the consumer application manually to the dead-letter queue, wait for the confirmation and then reject."
John Donn
  • 1,718
  • 2
  • 19
  • 45