Kuzey
Kuzey

Reputation: 879

Retrieving Azure Queue message length in C#

I noticed CloudQueue.ApproximateMessageCount would return the number of messages including the expired ones. This is probably a bug. Is there any way to see how many messages are in the queue?

Upvotes: 1

Views: 212

Answers (1)

Casey
Casey

Reputation: 805

So after doing some digging around I think I found the behavior you're talking about. From what I can tell the messages are still in the queue when they expire but aren't retrievable. They seem to remain in there for a short period of time and then are cleared out.

If I had to guess it may be similar to a storage bus queue in that expired messages are moved to some sort of dead letter queue. Except with storage queues you can't access the dead letter queue and the dead letter queue is automatically cleared after some period of time.

I'll update this answer if I find more.

Edit

I confirmed the behavior. It seems expired messages remain in the queue but you can't interact with them. They disappear eventually without intervention it appears.

Upvotes: 1

Related Questions