public override void MoveAllErrorMessagesToOriginQueue(string errorQueue)
        {
            var mgr = new ErrorManager();

            try {
                if (errorQueue != null)
                {
                    mgr.InputQueue = Address.Parse(errorQueue);

                    mgr.ReturnAll();
                }
                else // Return All Error Queues

                {
                    foreach (var queue in MonitorQueues.Where(q => q.Type == QueueType.Error))
                    {
                        mgr.InputQueue = Address.Parse(errorQueue = queue.Name);

                        mgr.ReturnAll();
                    }
                }
            } catch (Exception e) {
                throw new Exception("Failed to Move Messages from Error Queue '{0}' to Origin".With(errorQueue), e);
            }
        }
Exemplo n.º 2
0
        private void LoadQueues()
        {
            _monitorQueues.Clear();

            foreach (var queue in MonitorQueues)
            {
                AddAzureQueue(ConnectionString, queue);
            }

            // Add Dead Letter (Error) Queues for all Normal Queues
            foreach (var queue in MonitorQueues.Where(q => q.Type != QueueType.Error))
            {
                if (!_monitorQueues.Any(q => q.Queue.Name == queue.Name && q.IsDeadLetterQueue))
                {
                    AddAzureQueue(ConnectionString, queue, true);
                }
            }
        }