10

I have a simple Storage Queue setup that I'm adding messages too.

These messages were received by an Azure Function but they've failed processing.

Showing 0 of 3 messages in queue

Why can't I see the "failed" messages in the Storage Explorer?

enter image description here

aherrick
  • 19,799
  • 33
  • 112
  • 188

1 Answers1

10

Please note that Azure Storage Explorer is using Peek Messages API to show messages in a queue:

This operation retrieves one or more messages from the front of the queue, but does not alter the visibility of the message.

However, while Azure Function is processing the messages, it's using Get Messages API which makes the messages invisible to other consumers for a while:

The message is not automatically deleted from the queue, but after it has been retrieved, it is not visible to other clients for the time interval specified by the visibilitytimeout parameter.

Typically, when a consumer retrieves a message via Get Messages, that message is usually reserved for deletion until the visibilitytimeout interval expires, but this behavior is not guaranteed. After the visibilitytimeout interval expires, the message again becomes visible to other consumers. If the message is not subsequently retrieved and deleted by another consumer, the original consumer can delete the message using the original pop receipt.

In conclusion, if your messages weren't deleted by Azure Function (I guess it's the case per "Showing 0 of 3 messages in queue" message), you'll be able to see them after visibilitytimeout.

Community
  • 1
  • 1
Zhaoxing Lu
  • 6,319
  • 18
  • 41
  • Thanks for the answer. So how do I delete the message if it's not visible to me in Storage Explorer? I don't understand how this makes sense. Why does it not just show the message but change the state? – aherrick May 12 '18 at 13:46
  • Unfortunately it's impossible to delete them if those messages are invisible. It makes sense to me, since Azure Storage Explorer is just a consumer, and it should not have the permission to delete messages that are still being processed by other consumers. – Zhaoxing Lu May 12 '18 at 14:43
  • So there is a no way to delete a message once it’s been picked up for process? – aherrick May 12 '18 at 14:54
  • 2
    You may call Clear Messages (https://learn.microsoft.com/en-us/rest/api/storageservices/clear-messages) API to clear all messages in a queue regardless of popreceipt and visibilitytimeout. – Zhaoxing Lu May 12 '18 at 21:48
  • Is that not built into Storage Explorer? – aherrick May 14 '18 at 13:28
  • 2
    Clear Messages is built into Storage Explorer - there is a "Clear Queue" toolbar button, which removes all messages including those that are not visible in Storage Explorer. – Phil Seeman Jan 18 '19 at 18:40