Ragavendar S

Ragavendar S

  • NA
  • 192
  • 9.7k

Storage Queue Deletion

Oct 10 2017 9:18 AM

Hi , 

I have created a storage queue (Azure Web) and added some elements to the that queue, while tried to delete the particular message in the queue based on id only top element in the queue gets deleted.
 
 

public string DeleteMsgQueue(string connectionString, string queueName)

{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
 
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
 
CloudQueue queue = queueClient.GetQueueReference(queueName); CloudQueueMessage retrievedMessage = queue.GetMessage();
// await queue.DeleteMessageAsync(message.Id, retrievedMessage.PopReceipt);
queue.DeleteMsg(retrievedMessage);
return "Message De-Queued";
 
}
 

Answers (3)