public async Task PurgeErrorMessages(string queueName)
        {
            _log.Trace("Purge Error Messages in " + queueName);

            InvokeWhileMonitoringPaused(() => {
                _mgr.PurgeErrorMessages(queueName);
            });
        }
Example #2
0
        private void SetupContextMenu()
        {
            var items = lbItems.ContextMenu.Items;

            if (_mgr.MonitorQueues.Any(q => q.Type == QueueType.Error))
            {
                miReturnAllErr.IsEnabled = true;
                miPurgeAllErr.IsEnabled  = true;

                // Return All error messages
                var mi = miReturnAllErr;
                mi.Items.Clear();
                foreach (var q in _mgr.MonitorQueues.Where(q => q.Type == QueueType.Error))
                {
                    var m2 = new MenuItem()
                    {
                        Header = q.Name
                    };
                    m2.Click += (sender, e) => { _mgr.MoveAllErrorMessagesToOriginQueue(q.Name); };

                    mi.Items.Add(m2);
                }

                // Purge all error messages
                mi = miPurgeAllErr;
                mi.Items.Clear();
                foreach (var q in _mgr.MonitorQueues.Where(q => q.Type == QueueType.Error))
                {
                    var m2 = new MenuItem()
                    {
                        Header = q.Name
                    };
                    m2.Click += (sender, e) => { _mgr.PurgeErrorMessages(q.Name); };

                    mi.Items.Add(m2);
                }
            }
            else
            {
                miReturnAllErr.IsEnabled = false;
                miPurgeAllErr.IsEnabled  = false;
            }
        }
Example #3
0
        private void SetupContextMenu()
        {
            var items = lbItems.ContextMenu.Items;


            if (_sys.GetUnprocessedItemsCount(QueueType.Error) > 0)
            {
                miReturnAllErr.IsEnabled = true;
                miPurgeAllErr.IsEnabled  = true;

                // Return All error messages
                var mi = miReturnAllErr;
                mi.Click += (sender, e) => {
                    try {
                        _mgr.MoveAllErrorMessagesToOriginQueue(null);
                    } catch (Exception ex) {
                        _sys_ErrorOccured(this, new ErrorArgs("Failed to move messages to Orgin Queues", ex));
                    }
                };
                mi.Items.Clear();
                foreach (var q in _mgr.MonitorQueues.Where(q => q.Type == QueueType.Error))
                {
                    var m2 = new MenuItem()
                    {
                        Header = q.Name
                    };
                    m2.Click += (sender, e) => { _mgr.MoveAllErrorMessagesToOriginQueue(q.Name); };

                    mi.Items.Add(m2);
                }

                // Purge all error messages
                mi = miPurgeAllErr;
                mi.Items.Clear();
                foreach (var q in _mgr.MonitorQueues.Where(q => q.Type == QueueType.Error))
                {
                    var m2 = new MenuItem()
                    {
                        Header = q.Name
                    };
                    m2.Click += (sender, e) => { _mgr.PurgeErrorMessages(q.Name); };

                    mi.Items.Add(m2);
                }
            }
            else
            {
                miReturnAllErr.IsEnabled = false;
                miPurgeAllErr.IsEnabled  = false;
            }


            miPurgeMsg.IsEnabled = _features.Any(f => f == ServiceBusFeature.PurgeMessage);

            if (miReturnAllErr.IsEnabled)
            {
                miPurgeAllErr.IsEnabled = _features.Any(f => f == ServiceBusFeature.PurgeAllMessages);
            }

            miReturnErrToOrgin.IsEnabled = _features.Any(f => f == ServiceBusFeature.MoveErrorMessageToOriginQueue);

            if (miReturnAllErr.IsEnabled)
            {
                miReturnAllErr.IsEnabled = _features.Any(f => f == ServiceBusFeature.MoveAllErrorMessagesToOriginQueue);
            }
        }
Example #4
0
 public async Task PurgeErrorMessages(string queueName)
 {
     InvokeWhileMonitoringPaused(() => {
         _mgr.PurgeErrorMessages(queueName);
     });
 }