Exemplo n.º 1
0
        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)));
        }
Exemplo n.º 2
0
        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));
            }
        }