1

I'm using RabbitMQ with pika (Python), and I'm wondering if there's a way to determine how many times a message has been re-queued?

The general idea is that I'd like my worker to be able to tell that the message it's dealing with has been rejected/re-queued X times before, and then take appropriate action to do some error processing and then explicitly remove the item from the queue if it reaches a limit of Y retries.

I know that I could potentially make a copy of the the message, increment the value of the priority property (or even increment a value in the headers), then publish the copy to the queue and then ack the original message (similar to the approach of this example I found), but I would prefer to explicitly nack and re-queue the message.

Any ideas?

Craig Sefton
  • 903
  • 11
  • 20
  • Suggested similar question with few answers you may find useful http://stackoverflow.com/questions/18261702/can-rabbitmq-consumer-configure-to-consume-only-a-defined-number-of-attempts-for – pinepain Aug 29 '13 at 07:27
  • Thanks for the comment @zaq178miami, very helpful. If I can't figure out another way of doing it, the dead-letter exchange seems like a good way to go about it. – Craig Sefton Sep 02 '13 at 10:18

0 Answers0