Oldest Message

Microsoft.MSMQ.2008.Monitor.Queue.OldestMessage (UnitMonitor)

This monitor checks the age of the oldest message in a queue.

Knowledge Base article:

Summary

This monitor checks the age of the oldest message in a queue.

Configuration

This monitor is disabled by default. For it to operate, it must be enabled with an override.

The behavior of this monitor may be modified with an override setting the following parameters.

IntervalSeconds

The number of seconds between execution of the test. If this value is set too low, it could result in excessive overhead against the MSMQ service. If it is set to high, an error condition may not be detected within a suitable time. Default setting is 120 seconds (execute the test every 2 minutes).

WarningThresholdValue

Age of the oldest message in seconds at which an warning state should be generated.

ErrorThresholdValue

Age of the oldest message in seconds at which an error state should be generated.

Causes

Under normal operation, it is expected that applications will receive messages in a timely manner as they are added to the queue. If a message remains on the queue for an extended period of time, it can indicate a problem with the receiving application or that application's ability to read from the queue.

Resolutions

Check the connection status of the queue and applications that may be receiving messages from it.

Element properties:

TargetMicrosoft.MSMQ.2008.Queues
Parent MonitorSystem.Health.PerformanceState
CategoryAvailabilityHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.MSMQ.2008.MonitorType.QueueStatistic.ThreeState
RemotableTrue
AccessibilityPublic
Alert Message
The age of the oldest message in the queue has exceeded the threshold.
Please see the alert context for details.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.MSMQ.2008.Monitor.Queue.OldestMessage" Accessibility="Public" Enabled="false" Target="Microsoft.MSMQ.2008.Queues" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.MSMQ.2008.MonitorType.QueueStatistic.ThreeState" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.MSMQ.2008.Monitor.Queue.OldestMessage.AlertMessageResourceID">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ExceededErrorThreshold" MonitorTypeStateID="ErrorState" HealthState="Error"/>
<OperationalState ID="ExceededWarningThreshold" MonitorTypeStateID="WarningState" HealthState="Warning"/>
<OperationalState ID="WithinThreshold" MonitorTypeStateID="SuccessState" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>300</IntervalSeconds>
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
<QueuePath>$Target/Property[Type="Microsoft.MSMQ.2008.Queue"]/PathName$</QueuePath>
<CounterName>Oldest Message Age</CounterName>
<LogDetail>false</LogDetail>
<WarningThresholdValue>0</WarningThresholdValue>
<ErrorThresholdValue>0</ErrorThresholdValue>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>