Поделиться через


Retrieving the Lookup Identifier of a Message

 

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

The local queue manager generates the lookup identifier and sets the lookup identifier property of the message (PROPID_M_LOOKUPID and MSMQMessage.LookupId) whenever it places a message in a queue. However, the local queue manager does not notify the receiving application that a message with a specific lookup identifier arrived at the queue.

Consequently, the receiving application is responsible for retrieving and caching the lookup identifiers of all the messages that it may want to retrieve.

One way the receiving application can do this is to have a Message Queuing trigger associated with the queue so that every time a message is placed in the queue the trigger is fired. The trigger could invoke a component that retrieves the message identifier (or some other message property that identifies the message) and lookup identifier of each message that the receiving application may want to retrieve. The trigger could retrieve the lookup identifier of every messages that is placed in the queue or only those messages that have a specific label, correlation identifier, or some other message property. For information on triggers, see Triggers.

More Information

For Information On See
Example code that navigates a queue based on lookup identifiers Navigating Queue Examples