Dealing with dead letters in RabbitMQ : <p>TL;DR: I need to "replay" dead letter messages back into their original queues once I've fixed the consumer code that was originally causing the messages to be rejected.</p>

<p>I have configured the Dead Letter Exchange (DLX) for RabbitMQ and am successfully routing rejected messages to a dead letter queue.  But now I want to look at the messages in the dead letter queue and try to decide what to do with each of them.  Some (many?) of these messages should be replayed (requeued) to their original queues (available in the "x-death" headers) once the offending consumer code has been fixed.  But how do I actually go about doing this?  Should I write a one-off program that reads messages from the dead letter queue and allows me to specify a target queue to send them to?  And what about searching the dead letter queue?  What if I know that a message (let's say which is encoded in JSON) has a certain attribute that I want to search for and replay?  For example, I fix a defect which I know will allow message with PacketId: 1234 to successfully process now.  I could also write a one-off program for this I suppose.</p>

<p>I certainly can't be the first one to encounter these problems and I'm wondering if anyone else has already solved them.  It seems like there should be some sort of Swiss Army Knife for this sort of thing.  I did a pretty extensive search on Google and Stack Overflow but didn't really come up with much.  The closest thing I could find were shovels but that doesn't really seem like the right tool for the job.</p>
