"Insufficient resources to perform operation." MSMQ when transaction contains multiple messages

13,798

Solution 1

One of the message was exceeding the 4 Mb limit - once this was sorted everything worked as expected.

Solution 2

Just to add for issue number #7 storage space and Mitch's Answer.

Your quota size is the physical size on disk and not the queue reported size (as reported in apps like QueueExplorer or performance monitor).

So even though you have purged your queue you haven't actually removed them from disk (its meant to be cleaned every six hours)-

The default location is C:\Windows\System32\msmq\storage , or get it from the 1st link in Mitch's answer.

To clean up you can't just delete the files.

Try the below script (save as myScript.vbs). Run this as administrator from command prompt using:

cscript myScript.vbs

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"

After this our files dropped from 1Gb to about 50 mb even though the bytes in queues reported 40mb.

credit to thread: https://groups.google.com/forum/#!topic/microsoft.public.msmq.performance/jByfXUwXFw8

Solution 3

If it's the Quota problem (#7 in that article): Set the Message Storage Size for Computers

How to set up computer quotas and queue quotas in Microsoft Message Queuing

Administering Message Queuing Operations

Share:
13,798
AwkwardCoder
Author by

AwkwardCoder

Updated on June 27, 2022

Comments

  • AwkwardCoder
    AwkwardCoder almost 2 years

    I'm moving an application from one server to another and the new server returns the 'famous' - "Insufficient resources to perform operation." message when the code attempts to send multiple messages to a queue, the process is wrapped inside a transaction (TransactionScope). The old server executes the code correctly and all the messages (150 approx) are sent to the queue as expected, but the new server fails at apporx 27.

    Now the message size is small and the number of messages on the queue is zero.

    I've read the 'Insufficient Resources? Run away, run away!' article but I'm unsure how to change machine quotas for MSMQ.

    The app log has the following entry:

    System.Messaging.MessageQueueException (0x80004005): Insufficient resources to perform operation.

    Technology is C# & .Net 4.0, server is win 2003 R2 SP2

    Any ideas why I'm getting this?

  • John Breakwell
    John Breakwell about 13 years
    You definitely want to have checks inside your app to catch that and make sure you keep up with message format changes. blogs.msdn.com/b/johnbreakwell/archive/2007/08/22/… blogs.msdn.com/b/johnbreakwell/archive/2007/06/29/…
  • AwkwardCoder
    AwkwardCoder about 13 years
    John, Thanks, just done that and made sure it can't happen again, it was around the size of an image and the fact we hadn't put an upper restriction or more importantly an image type restriction in...
  • Dave Sanders
    Dave Sanders over 4 years
    How did you determine you had a message > 4mb?