Question

I try to add 50 messages in an Azure Queue, but seems only the first 32 get queued.

Following the documentation I create a queue like this:

var storageAccount = CloudStorageAccount
                      .Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
var queueClient = storageAccount.CreateCloudQueueClient();
var queueName = "queue-" + Guid.NewGuid();
_queue = queueClient.GetQueueReference(queueName);
_queue.CreateIfNotExists();

Then I add messages to the queue:

for (int i = 0; i < count; i++) {
    var message = new CloudQueueMessage("message" + i);
    _queue.AddMessage(message);
}

I open the Queue from Server Explorer-> Windows Azure-> Storeage-> Queues to check what's inside but only the first 32 appear.

I am missing something?

Was it helpful?

Solution

Well, it's seems the problem was with the way that I check for queued messages. If programmatically I check it like this:

_queue.FetchAttributes();
Assert.AreEqual(count, _queue.ApproximateMessageCount);

then I see that all messages have been successfully added, even for count > 32.

However, at Server Explorer window when hitting "View Queue", I guess what happens behind the scenes is a GetMessages request which has a limit of 32.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top