Microsoft KB Archive/173325
Article ID: 173325
Article Last Modified on 8/28/1999
- Microsoft Message Queue Server 1.0
This article was previously published under Q173325
Microsoft Message Queue Server (MSMQ) does not come with "trigger" functionality for queues. A "trigger" is a software component that monitors a queue for a certain condition and performs some action when that condition is met. Currently, trigger functionality must be implemented in the application. The MSMQ software development kit (SDK) provides documentation on how to use notification events to provide asynchronous handling of messages, which is one kind of trigger functionality. However, you can also use Performance Monitor counters to monitor for triggering conditions. This article points you to a sample application that shows you how to write a trigger using a Performance Monitor counter.
The sample, "MQTrigger," is written in Visual Basic and C++. It uses a timer event to periodically poll a Performance Monitor counter for a message count. The sample application displays a dialog box when the message count in a queue reaches the threshold.
Note that monitoring through counters limits you to the functionality of the counters. For example, counters operate locally only, so MQTrigger will not access the queues on a remote computer. MSMQ Performance Monitor counters are limited to showing 64 queues. Also, the sample does not run under Windows 95 because it relies on the Windows NT Performance Monitor counters.
Triggering on changes other than those that can be measured through a counter will require different implementations.
For more information on asynchronous notification, see the online Help in the MSMQ SDK.
The sample application is located at:
For more information on Performance Monitor, see the "Optimizing Windows NT" volume of the Windows NT 3.51 Resource Kit.
Additional query words: Perfmon app
Keywords: kbhowto kbprogramming kbfaq KB173325