Trim Journal Queue

Microsoft.MSMQ.2003.Recovery.TrimJournalQueue (Recovery)

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.2003.Queue
MonitorMicrosoft.MSMQ.2003.Monitor.Queue.JournalPercentage
Reset MonitorTrue
RemotableTrue
Timeout300
CategoryAvailabilityHealth
Enabledfalse
AccessibilityPublic

Member Modules:

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

Source Code:

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