Example #1
0
        private StorageQueueMessage <T> DeserializeMessage(StorageQueueMessage message)
        {
            if (message == null)
            {
                return(null);
            }

            return(new DeserializedStorageQueueMessage <T>(_messageSerializer.Deserialize(message.Contents), message));
        }
Example #2
0
        public async Task RemoveAsync(StorageQueueMessage message, CancellationToken token)
        {
            if (!(message is AzureStorageQueueMessage))
            {
                throw new ArgumentException("This message was not returned from this queue!", nameof(message));
            }

            await(await _queueTask.Value).DeleteMessageAsync((message as AzureStorageQueueMessage).Message, token);
        }
Example #3
0
 private StorageQueueMessage SerializeMessage(StorageQueueMessage <T> message)
 {
     if (message is DeserializedStorageQueueMessage <T> deserializedMessage)
     {
         return(deserializedMessage.Message);
     }
     else
     {
         return(new StorageQueueMessage(_messageSerializer.Serialize(message.Contents), message.DequeueCount));
     }
 }
Example #4
0
 public Task RemoveAsync(StorageQueueMessage <T> message, CancellationToken token)
 {
     return(_queue.RemoveAsync(SerializeMessage(message), token));
 }