It might be worth looking at the Performance Counters for MSMQ to see what
the values for total messages in all queues and total bytes in all queues
are, just to make sure there isn't something you've overlooked.
>Could these be old
> journal messages that I have not deleted.
It's possible. the perfmon counters would help - the "messages in queue"
and "messages in journal queue" counters for example.
> If I disable journaling on the
> queues will the files then be deleted after 6 hours or an MSMQ restart or
> will I have to manually remove the files ?
Disabling journaling will stop new messages being placed in the journal
queue but it won't delete any messages already in the queue. If the problem
is journal messages and you don't want to keep them around, then you should
purge the journal queue(s). The perfmon counters will help you figure out
which journal queues have any messages in them (and so need purging). Open
up Computer Management and find the queue in question. Expand that queue
and you should see a "Queue messages" node and a "Journal Messages" node.
Right click on either node and select "All Tasks | Purge" to purge those
messages.
Manually removing the disk files is risky because MSMQ doesn't expect those
files to disappear. I imagine MSMQ would most likely recover from the shock
but you might lose other data as well. Worst case you might have to
re-install MSMQ.
174307
Interpreting file names in the Storage directory in Microsoft Message Queue
Server and in Microsoft Message Queuing
http://support.microsoft.com/default.aspx?scid=kb;EN-US;174307
Deleting JUST the P*.MQ, J*.MQ, R*.MQ and L*.MQ files will not impact the
MSMQ installation and you won't need to reinstall. Always ensure the MSMQ
service is stopped and always make a backup first with MQBKUP.EXE before
deleting anything.
If you delete any other files in the Storage directory (e.g. QMLOG) then you
will need to rebuild them after editing the regsitry. You will need to set
LogDataCreated=0 and restart MSMQ service. LogDataCreated is described here:
Cheers
John Breakwell
Would you know if there are any issues in deleting/moving any of the .mq
files to free up space? I have over 5gb used by loads of .mq files.
Before you delete or move these files, you should probably try to free
up the space the MSMQ way.
The first question to ask is whether you have 5 GB of messages sitting
in queues or not. If the 5GB mostly represents a bunch of unprocessed
messages sitting in one or more queues then you need to remove those
messages from the queue (or queues), either by running whatever program
should consume the messages or by purging the queue(s).
To examine the number of bytes tied up in queues, you can use
Administrative Tools | Performance monitor to examine the "MSMQ Service"
performance object's "Total bytes in all queues" counter.
One way to purge a queue is to run the Computer Management snapin,
expand Services and Applications, expand Message Queuing, expand
private, Public, System or Outgoing queues, expand the queue you want to
purge, right click on "QueueMessages", select "All tasks" and then
Purge.You can also purge queues programmatically.
Purging the queues will not free up your .MQ files though. When a
message is deleted from a queue, the space is still used up in the .mq
file, it is just marked to sjhow that the message has been deleted. To
actually free up the space, MSMQ has to go through a cleanup process to
garabage collect the space and throw away the unused .mq files.
Normally, MSMQ will cleanup every six hours (or every
MessageQueueInterval milliseconds if that registry key is set). You can
also force a cleanup programmatically.
If you are running MSMQ 3.0 or later, the following snippet of VBScript
code will report the total number of bytes in all queues and will force
a cleanup. If you run the script and the number of bytes reported is
low, the Tidy should free up your 5GB. If the bytes in all queues is
closer to 5 GB or if the mq files are really checkerboarded you may need
to purge one or more queues before the Tidy will have any effect.
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"