HOWTO: How to Write an MSMQ Trigger Application

Last reviewed: January 28, 1998
Article ID: Q173325
The information in this article applies to:
  • Microsoft Message Queue Server, version 1.0

SUMMARY

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.

MORE INFORMATION

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:

   ftp://ftp.microsoft.com/bussys/distapps/msmq/samples/1.0/mqtrigger.exe

REFERENCES

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 : kbprg MQProg kbfaq
Version : WINDOWS NT:1.0
Platform : winnt
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 28, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.