question

stevemrf-4055 avatar image
0 Votes"
stevemrf-4055 asked stevemrf-4055 answered

Storage Queue Client reports 0 messages regardless of message state, visibily or expiry date

Hi Folks,

This queue has been working fine until today. I have fresh messages in a storage queue (I just added them) and when I call

QueueProperties properties = await theQueue.GetPropertiesAsync();

the approx count is 0.

I saw this queue-is-not-empty and this queue-shows-false-count

From a few years ago but none of the possible reasons mentioned seem to apply in my case. Message are new and unread. It doesn't appear to matter how many are there. The queue exists and looks like its being read, no errors anywhere as far as I can see.


This is my code to get & delete a message

 QueueClient client = new QueueClient(connection, queue);
    
 if (await client.ExistsAsync())
             {
                 QueueProperties properties = await client.GetPropertiesAsync();
    
                 if (properties.ApproximateMessagesCount > 0)
                 {
                     QueueMessage[] qmsg = await client.ReceiveMessagesAsync(1);
                     string msg = qmsg[0].MessageText;
                     await client.DeleteMessageAsync(qmsg[0].MessageId, qmsg[0].PopReceipt);
                     return msg;
                 }
             }


Sod's law this has happened at the end of a piece of development that is vital in a user registration story. I can't proceed without resolving this so any suggestions welcome and greatly appreciated.

Thanks in advance


azure-queue-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

stevemrf-4055 avatar image
0 Votes"
stevemrf-4055 answered

Of course it helps if you're pointing at the right storage account.

Please ignore my question.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.