MSMQ.MSMQApplication BytesInAllQueues显示大数字,队列中没有可见的消息

时间:2015-04-21 16:24:48

标签: msmq

我有一个vbs脚本[1]整理了MSMQ,它显示我在所有队列中都有~1GB。但是,使用GUI工具和一些PShell脚本[2]我看不到队列消息。

如何真正清除这些队列?

[1]

Option Explicit

Dim mqa
set mqa = WScript.CreateObject("MSMQ.MSMQApplication")

WScript.Echo "Bytes in all queues: " + CStr(mqa.BytesInAllQueues)

mqa.Tidy

WScript.Echo "MSMQ cleaned up"

[2]

[Reflection.Assembly]::LoadWithPartialName("System.Messaging")
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine(".") | % { if($_.GetAllMessages().Length -gt 0) { $_.QueueName + $_.GetAllMessages().Length } $_.Purge(); }

0 个答案:

没有答案
相关问题