Search code examples
rabbitmqspring-amqpspring-rabbit

Rabbit : Set message delivery mode to PERSISTENT when routed to dead letter Q


I just want to get the messages routed to dead letter queue after rejection by rabbit listener to be PERSISTENT (only after the rejection by the listener NOT in the original Q).

If there is a way to make the whole dead letter queue PERSISTENT(regardless the message delivery mode), it will also do the job for me.

Thanks in advance


Solution

  • I don't believe that's possible because the original message is moved to the DLQ, but you could ask the rabbitmq engineers on the rabbitmq-users google group.

    You could republish it yourself with a PERSISTENT delivery mode instead.

    The Spring AMQP RepublishMessageRecover can be used for that docs here; it also adds more information (stack trace etc.) to the message.