5

I need to keep track of how many failed attempts have been made to process a message in an azure storage queue and delete the message after N unsuccesful attempts.

I have searched, but have not found any particular property that does this automaticaly and was wondering if there was a way other than using a counter in a storage table.

AJC
  • 1,853
  • 1
  • 17
  • 28

1 Answers1

7

Each cloud queue message has a DequeueCount property. Does this help?

REST API reference here.

As for how to delete messages automatically after n attempts: There's nothing that automatically does this. You'll need to implement your own poison-message handling in Windows Azure queues, based on DequeueCount.

Alternatively, Azure Service Bus queues have a dead-letter queue for undeliverable messages (or ones that can't be processed). More info here.

David Makogon
  • 69,407
  • 21
  • 141
  • 189
  • Thanks!, that was it... I had seen something of the sort a while back but could not for the life of me remember or find it. It is a metadata property right? So I just check before processing a message and if its over the established limit, I'll delete it. – AJC Nov 10 '11 at 15:33
  • 1
    Right - each message has its own DequeueCount - it will initially equal 1 the first time you get a message from the queue. – David Makogon Nov 11 '11 at 05:56