1

Is there a way to ensure when you NACK a message and it gets sent to a dead letter exchange/queue that it will be persistent? It seems by default even if the original message is set as persistent with SetPersistent(true), the dead lettered message does not follow suite.

Deofol
  • 23
  • 4
  • is there a reason not to just set the entire dead-letter queue as persistent? – jhilden May 21 '15 at 18:04
  • Is that an option? So far I have only found that you can set the persistence on the message level. Since rabbit handles the dead letter publish, I can't find a way for it to set the persistent bit in the BasicProperties ( delivery_mode = 2). – Deofol May 21 '15 at 18:14
  • Yes, you can make a whole queue persistent. The term Rabbit uses is "Durable". It means the queue will survive a rabbit and/or server shutdown – jhilden May 21 '15 at 18:30
  • Not exactly, durability is for the queue configuration only; not the messages in it. If you add messages without a delivery_mode = 2 (or SetPersistent(true) in the .net client) when the service is restarted or crashes, all messages in the queue are lost. I have verified this behavior. The problem is rabbit does not write the dead letter messages with the same persistence as the original message. So a service restart will drop all messages in the dead queue. – Deofol May 21 '15 at 18:38
  • If the message is tag as persistent and the DLQ tag as durable, the message should be persisted. Tested using RabbitMQ 3.5 – Nicolas Labrot May 22 '15 at 08:56

1 Answers1

1

RabbitMQ doesn't modify the properties of Dead Letter'ed messages, except for the expiration one: https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_dead_letter.erl#L74

If the message was published with deliver_mode=2, then it should be published as persistent into the Dead Letter Queue

old_sound
  • 2,243
  • 1
  • 13
  • 16