Applications may receive error messages about insufficient resources in Message Queuing (901279)



The information in this article applies to:

  • Microsoft Message Queue Server (MSMQ) 2.0
  • Microsoft Message Queuing 3.0

Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry

SYMPTOMS

In Microsoft Message Queuing (also known as MSMQ), applications may intermittently receive error messages about insufficient resources. This problem may occur when any one of the following conditions is true:
  • You run a local Message Queuing-enabled application to monitor many queues for arriving messages.
  • You run several Message Queuing-enabled applications to monitor local queues for arriving messages.
  • You run several Message Queuing-enabled applications that receive messages or monitor for message arrival events from a queue on another computer.

CAUSE

If you are running Message Queuing-enabled applications to monitor queues for arriving messages, this problem probably occurs because you have exceeded the number of local callback threads that are permitted. Message Queuing has a callback thread limit of 63 for local queues. The limit on callback threads for local queues is by design and cannot be changed. Callback threads are used to monitor for arriving messages. The threads permit applications to attach to a queue and perform a specific action when a message arrives. Because of the callback threads, the developer does not have to use a timer or some other mechanism that cannot guarantee that an action will be performed when a message arrives.

Note Systems that are running Windows XP or Windows Server 2003 are also affected by the local callback threads limitation.

If you are running several Message Queuing-enabled applications that receive messages or monitor for message arrival events from a queue on another computer, this problem probably occurs because you have exceeded the number of remote reads that can be made against Message Queuing on a remote computer. When the application reads from a remote queue, a thread is created by the local Message Queuing service that waits for the remote read on the remote computer to be completed. The default threshold of threads that are created to handle these requests is based mainly on the version of the operating system that you are running. In Windows 2000 Professional, the default limit is 24. In Windows 2000 Server, the default limit is 96.

Note Systems that are running Windows XP or Windows Server 2003 are not affected by the remote receive threads limit.

RESOLUTION

If you are running Message Queuing-enabled applications to monitor queues for arriving messages, the limit is hard-coded into Message Queuing and cannot be changed. Changes must be made to application architecture to resolve this problem.

If you are running several Message Queuing-enabled applications that receive messages or monitor for message arrival events from a queue on another computer, you may reconfigure Message Queuing to use more remote receive threads. Unlike local callback threads, Message Queuing can be configured to use more remote receive threads. To reconfigure Message Queuing to use more remote receive threads, change the value of the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters\MaxRRThreads registry subkey. To do this, follow these steps.

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.
Follow these steps, and then quit Registry Editor:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following key in the registry:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters

  3. On the Edit menu, point to New, and then click DWORD.
  4. Type MaxRRThreads, and then press ENTER.
  5. On the Edit menu, click Modify.
  6. Type 96, and then click OK.

MORE INFORMATION

For more information about Message Queuing, visit the following Microsoft Web site: For more information about Resource Management in Message Queuing applications, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:2/9/2006
Keywords:kbtshoot kbprb KB901279 kbAudDeveloper