Queue size task

This task checks queue size on scheduled intervals. When queue size is bigger than specified, alert will be raised. When size goes back to normal, recovery notification will be sent too.

This task is not only about alerting. When alert is raised, this task can go through queue and perform Message actions on some or all messages in a queue.

Usage examples

  • Monitor dead letter queues, raise alert when there’s one or more messages there - allow admin to investigate why these messages were not delivered.
  • Monitor queue size, if it contains more than 100 messages raise alert, processing is slow for some reason and messages are piling up.
  • Monitor journal size, if it reaches 90% of quota, backup oldest messages to file and delete them from a queue to prevent blocking entire queue.

When will this task traverse a queue and process messages

When size limit is reached and alert is raised, QueueMonitor will check whether it should process messages from a queue. If there’s at least one action specified, or if Delete messages after processing is selected, QueueMonitor will start receiving messages from a queue and process them. It will stop when there are no more messages or if some of optional filtering conditions are met, e.g. only Top 100 messages.

Source

Choose one or more queues. If you pick more than one queue, each queue will be saved separately. In order to separate backup files it’s advisable to use queue name as part of folder or file name.

Picking source queues

Size checks

This step defines how QueueMonitor checks queue size.

Queue size as percent of max size (quota)

QueueMonitor will compare queue’s quota, as specified in MSMQ, and how much of it is used currently. This type of check should not be used for dead letter or outgoing queues since they don’t have quota specification. Since MSMQ queue and journal quotas are specified in kilobytes, this type of check takes into account total size of messages in kilobytes and not their count.

This option is unavailable for remote queues, since MSMQ doesn’t let us see all properties of remote queues, including quota size.

Queue size in kilobytes

QueueMonitor will raise alert if queue size in kilobytes is above specified limit.

Message count

Raise alert when message count goes above specified limit.

Include subqueue messages
MSMQ API allows us to efficiently get message count, but it includes messages from all its subqueues. If you want to count only messages in main queue without any subqueues, turn this checkbox off. In that case check will be less efficient since we have to count by enumerating messages one by one.
Count only filtered messages
Filter messages before they are counted. If this is turned on, we have to load full messages into memory which can be slow. This allows scenario like “Raise alarm if there are 20 messages older than 10 minutes”.

Note

This filter only affects counting. There’s separate filtering which defines which messages will be processed after alert is raised.

Schedule

Configure when the checks should be performed. In most cases it should be Periodic check, every few minutes or seconds.

Configuring task schedule

Message filter

Configure which messages will be included in processing once alert is raised.

Message filtering

Actions

Configure actions which will be performed on each message once alert is raised.

Message actions

On failure

Specify list of alert actions which will be performed when check fails. By default, global default actions will be executed.

Alert actions

On recovery

Specify list of alert actions which will be performed when check succeeds again for the first time after failure. By default, global default actions will be executed.

Alert actions