Trim Journal Queue Recovery

Microsoft.MSMQ.2008.Recovery.TrimJournalQueue (Recovery)

This Recovery Trims the journal queue down to a predefined quota percentage usage.

Knowledge Base article:

Summary

Removes messages from the journal queue.

Configuration

Messages will be removed from the journal starting with the oldest and then continuing according to the specific logic. There are three different types of potential logic as follows:

quota

Remove messages until the quota percentage is reduced to the target value.

time

Remove all messages older than the specified date/time.

kbytes

Remove messages totaling the specified number of kilobytes.

purge

Removes all messages.

Element properties:

TargetMicrosoft.MSMQ.2008.Queues
MonitorMicrosoft.MSMQ.2008.Monitor.Queue.JournalPercentage
Reset MonitorTrue
RemotableTrue
Timeout300
CategoryAvailabilityHealth
Enabledfalse
AccessibilityPublic

Member Modules:

ID Module Type TypeId RunAs 
TrimQueue WriteAction Microsoft.MSMQ.2008.TrimQueue Default

Source Code:

<Recovery ID="Microsoft.MSMQ.2008.Recovery.TrimJournalQueue" Accessibility="Public" Enabled="false" Target="Microsoft.MSMQ.2008.Queues" Monitor="Microsoft.MSMQ.2008.Monitor.Queue.JournalPercentage" ResetMonitor="true" ExecuteOnState="Error" Remotable="true" Timeout="300">
<Category>AvailabilityHealth</Category>
<WriteAction ID="TrimQueue" TypeID="Microsoft.MSMQ.2008.TrimQueue">
<Computer>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</Computer>
<QueuePath>$Target/Property[Type="Microsoft.MSMQ.2008.Queue"]/PathName$</QueuePath>
<TargetQueue>journal</TargetQueue>
<TrimLogic>quota</TrimLogic>
<NumericParameter>60</NumericParameter>
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</Recovery>