All the triggers created on the local computer are listed in the details pane of Computer Management. To view the list, click Triggers in the console tree under the Triggers folder. For each trigger, the following are displayed by default in the details pane:

Before creating a trigger, verify that the account under which the Message Queuing Triggers service is running has been granted the necessary permissions. The Peek Message permission and the Receive Message permission are required for all existing queues that will be associated with triggers having the retrieval or transactional-retrieval processing type.

After a trigger has been created, you can attach existing rules to it.

Creating triggers

To create triggers
  1. Open Computer Management.

  2. In the console tree, underneath the Triggers folder, right-click Triggers.

    Where?

    • Computer Management/Services and Applications/Message Queuing/Triggers/Triggers

  3. Point to New, and then click Trigger.

  4. In Trigger name on the first page of the New Trigger dialog box, type a name for the new trigger.

  5. If you want to specify a user-defined queue as the monitored queue, in Queue path name, type the path of the queue with which the trigger will be associated in the ComputerName\QueueName syntax, or the .\QueueName syntax for the local computer. (Do not use format names.) Otherwise, click the name of an automatically created queue on your computer.

  6. Select Peeking, Retrieval, or Transactional retrieval to specify the type of message processing.

  7. Select the Enabled check box to configure the trigger as enabled; clear the Enabled check box to configure it as disabled.

  8. Select the Serialized check box to configure the trigger as serialized; clear the Serialized check box to configure the trigger as not serialized, and then click Next.

  9. On the second page of the New Trigger dialog box, to attach an existing rule to the trigger, select a rule in the Rules list, and then click Attach.

  10. To remove a rule from a trigger, select a rule in the Attached Rules list, and then click Detach.

  11. To change the order in which rules are tested for the triggers, click the Up and Down buttons.

  12. When you have the list of attached rules that you want, click Finish.

Additional considerations

  • To open Computer Management on Windows® 7, click Start, right-click Computer, and then click Manage.

  • To open Computer Management on Windows Server® 2008 R2, click Start, click All Programs, click Administrative Tools, and then click Computer Management.

  • You can also perform this procedure from the Triggers folder under any monitored queue in the console tree, by opening the New Trigger dialog box as follows: right-click Triggers, point to New, and then click Trigger. In this case, the queue automatically becomes the monitored queue.

  • After you type the name of a user queue to which the trigger will be associated in Queue path name, the existence of the queue is verified. If a queue with the name typed cannot be found, an error message appears.

  • Triggers can be serialized or nonserialized. A serialized trigger tests the conditions of all the rules associated with it on each message. It performs all the applicable actions before moving on to the next message in the order in which the messages arrive. However, the throughput is lower than for nonserialized triggers because the messages are processed one at a time.

    Nonserialized triggers permit higher throughput, but might fail to perform a given operation on the messages in the order in which they arrive. This occurs, for example, when multiple messages are processed simultaneously. If you create multiple triggers for a particular queue and at least one of them is serialized, all the triggers will behave as serialized triggers, even if they are not defined as serialized. Triggers with the transactional-retrieval processing type can only be serialized. If message-processing order is significant, it is better to use only a single trigger per queue and enable the serialized option because the order of trigger firing is random. The particular globally unique identifier (GUID) of a message does not affect the order.

  • By default, the Message Queuing Triggers service runs under the Network Service account. When the Message Queuing Triggers service is running under the Network Service account, it does not interact with the desktop. If this functionality is required, you can configure the Message Queuing Triggers service to run under the Local System account and enable interaction with the desktop in Computer Management. As a security best practice, do not change the default account to a less secure account unless absolutely necessary. The Message Queuing Triggers service must run under an account with administrator permissions.

  • Executable files that triggers invoke are invoked with the same security privileges as those assigned to the Message Queuing Triggers service.

  • When you delete a queue, the triggers associated with that queue are not deleted. If you later re-create a queue of the same name, any existing triggers will be used by this queue. However, the Message Queuing Triggers service will not monitor this re-created queue until the computer is restarted, or the associated triggers are disabled, and then enabled again. For information about setting the enabled or disabled property for a trigger, see View or Change Properties of Triggers and Rules for Triggers.

Additional references