Sergey
Sergey

Reputation: 8071

How to get number of faulted messages from queue

How can I obtain the count of faulted messages from a Windows Azure Storage Queue?

Upvotes: 1

Views: 678

Answers (1)

David Makogon
David Makogon

Reputation: 71030

If you're talking about Storage queues, where a queue item reappears due to something going wrong while processing (meaning the invisibility timeout expired), each message has a DequeueCount (which, upon first get, is set to 1, then incremented with each additional get). There's no way to discover the total number of reappearing messages.

With Service Bus queues, you can set up a dead-letter sub-queue, letting you move messages to this dead-letter queue conditionally:

  • expired messages
  • max delivery count met

This post has a good example of setting up a dead-letter sub-queue.

Upvotes: 2

Related Questions