I've seen blog posts, as well as answer #2 from this SO question How do I set a number of retry attempts in RabbitMQ? recommending that one way to keep track of the retry count on a RabbitMQ message is to publish it again with an x-redelivered-count
header.
Is this done by setting the header on a message as it's headed to the dead-letter exchange, or is it done by making a fresh copy of the message with the same headers and body as before, but plus an incremented x-redelivered-count
(while ACKing the old copy of the message?), and if it can be done with the former, how would I edit the headers or body of a message before it is dead-lettered?