Ejemplo n.º 1
0
 private async Task DeleteMessageAsync(IStorageQueueMessage message, CancellationToken cancellationToken)
 {
     try
     {
         await _queue.DeleteMessageAsync(message, cancellationToken);
     }
     catch (StorageException exception)
     {
         // For consistency, the exceptions handled here should match UpdateQueueMessageVisibilityCommand.
         if (exception.IsBadRequestPopReceiptMismatch())
         {
             // If someone else took over the message; let them delete it.
             return;
         }
         else if (exception.IsNotFoundMessageOrQueueNotFound() ||
                  exception.IsConflictQueueBeingDeletedOrDisabled())
         {
             // The message or queue is gone, or the queue is down; no need to delete the message.
             return;
         }
         else
         {
             throw;
         }
     }
 }
Ejemplo n.º 2
0
 protected override async Task DeleteMessageAsync(CloudQueueMessage message, CancellationToken cancellationToken)
 {
     FakeStorageQueueMessage fakeMessage = new FakeStorageQueueMessage(message);
     await _queue.DeleteMessageAsync(fakeMessage, cancellationToken);
 }