public void AddMessage(QueueMessageBase message) { var queueName = ResolveQueueName(message.GetType()); var json = Serialize(message.GetType(), message); var cloudQueue = this.storageRetryPolicy.ExecuteAction(() => this.queue.GetQueueReference(queueName)); this.storageRetryPolicy.ExecuteAction(() => cloudQueue.AddMessage(new CloudQueueMessage(json))); }
public void DeleteMessage(QueueMessageBase message) { var queueName = ResolveQueueName(message.GetType()); var originalMessage = message.GetContext() as CloudQueueMessage; if (originalMessage != null) { var cloudQueue = this.storageRetryPolicy.ExecuteAction(() => this.queue.GetQueueReference(queueName)); this.storageRetryPolicy.ExecuteAction(() => cloudQueue.DeleteMessage(originalMessage)); } }