Azure queue connection definition for a write-only queue.
상속: AzureQueueConnection
예제 #1
0
        // ReSharper disable once UnusedParameter.Local
        private int PostMessagesToDestQueue(AzureDestinationQueueConnection destQueue, IEnumerable <CloudQueueMessage> inboundMessages)
        {
            var outboundMessages = this.ConvertInboundMessagesToOutbound(inboundMessages).ToList();

            outboundMessages.ForEach(outMsgTuple => this.PostMessageToDestQueue(destQueue, outMsgTuple.Item1, outMsgTuple.Item2));

            return(outboundMessages.Count());
        }
예제 #2
0
        private void PostMessageToDestQueue(AzureDestinationQueueConnection destQueue, CloudQueueMessage outboundMessage, TimeSpan?ttl)
        {
            CloudQueueMessage outMsg = outboundMessage;

            try
            {
                destQueue.AddMessage(outMsg, ttl);
            }
            catch (StorageException ex)
            {
                const int queueNotFound = -2146233088;
                if (ex.HResult != queueNotFound) // Queue not found
                {
                    throw;
                }

                this.LogWarning("Queue \"{0}\" not found. Recreating.", destQueue.Queue.Name);
                // Re-create the queue and retry
                destQueue.Queue.CreateIfNotExists();
                destQueue.AddMessage(outMsg, ttl);
            }
        }
예제 #3
0
        private void PostMessageToDestQueue(AzureDestinationQueueConnection destQueue, CloudQueueMessage outboundMessage, TimeSpan? ttl)
        {
            CloudQueueMessage outMsg = outboundMessage;

            try
            {
                destQueue.AddMessage(outMsg, ttl);
            }
            catch(StorageException ex)
            {
                const int queueNotFound = -2146233088;
                if(ex.HResult != queueNotFound) // Queue not found
                    throw;

                this.LogWarning("Queue \"{0}\" not found. Recreating.", destQueue.Queue.Name);
                // Re-create the queue and retry
                destQueue.Queue.CreateIfNotExists();
                destQueue.AddMessage(outMsg, ttl);
            }
        }
예제 #4
0
        // ReSharper disable once UnusedParameter.Local
        private int PostMessagesToDestQueue(AzureDestinationQueueConnection destQueue, IEnumerable<CloudQueueMessage> inboundMessages)
        {
            var outboundMessages = this.ConvertInboundMessagesToOutbound(inboundMessages).ToList();

            outboundMessages.ForEach(outMsgTuple => this.PostMessageToDestQueue(destQueue, outMsgTuple.Item1, outMsgTuple.Item2));

            return outboundMessages.Count();
        }