Partager via


Tracing Messages

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

Message Queuing provides tracing support that allows you to track how messages reach their destination queues. When message tracking is enabled for the source computer and tracing is requested for a message, Message Queuing generates a report message each time the message is sent from or arrives at a computer.

Note

Message Queuing does not support tracing under the following conditions:

  • When you send messages locally to a queue on the same computer.

  • When you send messages to multiple destinations using distribution lists, multicast addresses, and multiple-element format names.

  • When you send messages over HTTP/HTTPS transport.

For example, if a message is sent with direct messaging (the message is sent directly to the target computer), two report messages would be generated. The first report message indicates that the message was sent from the source computer and the second report message indicates that the message arrived at the target computer.

However, when a message passes through a routing server on its way to its destination queue, the following report messages are generated:

  • A single report message is generated when the message leaves the source computer.

  • Two report messages (arrived and sent) are generated each time the message passes through a routing server.

  • A single report message is generated when the message arrives at the target computer.

To trace a message, you must specify the report queue where Message Queuing (or the connector application) will send its report messages and then enable tracing when you send the message. For more information on report queues, see Report Queues.

Selecting a Report Queue

Report queues are selected by the Message Queuing administrator through the Active Directory Users and Computers snap-in. They can be a local public queue or a remote public queue that resides on another computer.

Typically, the report queue is specified on the source computer where the message is sent. When the local queue manager sends the message, it adds the path of the report queue to the message so that the next computer will know where to send the report message. If the report queue is not specified by the source computer, Message Queuing will not generate report messages until the message arrives at a computer where a report queue is specified.

In addition to the report queue specified for the source computer, any computer in the enterprise can have its own report queue. When the message reaches a computer that has a report queue that is different from the report queue specified in the message, Message Queuing sends one report message to the queue specified in the message and another report message (containing a conflict report) to the report queue specified for the computer. For information on conflict reports, see Specifying Multiple Report Queues.

When specifying the report queue in Active Directory Users and Computers, the administrator must supply the complete path name for the queue. If the queue does not exist, Message Queuing creates the queue for the administrator. For information on selecting the report queue, see the Message Queuing Administrator's Guide in Windows® 2000 Help or open the online Help from Message Queuing in Computer Management on a computer running Windows XP Professional or a member of the Windows Server 2003 family.

Requesting Tracing and Reading Report Messages

Tracing is requested by setting the tracing property (PROPID_M_TRACE or MSMQMessage.Trace) of a message to MQMSG_SEND_ROUTE_TO_REPORT_QUEUE. When the message is sent, Message Queuing will trace its route to its destination queue provided message tracking is enabled.

To read report messages, verify that the class property (PROPID_M_CLASS or MSMQMessage.MsgClassMSMQMessage.MsgClass) of the message is set to MQMSG_CLASS_REPORT and then look at the label of the message. Message Queuing puts the report information in the label of the report message.

For information on what is in report messages, see Report Messages.

For an example of See
Requesting tracing C/C++ Code Example: Requesting Tracing

 Visual Basic Code Example: Requesting Tracing
Reading messages in report queues C/C++ Code Example: Reading Report Messages

 Visual Basic Code Example: Reading Report Messages