This topic has not yet been rated - Rate this topic

Message.LookupId Property

Note: This property is new in the .NET Framework version 2.0.

Introduced in MSMQ 3.0. Gets the message's lookup identifier.

Namespace: System.Messaging
Assembly: System.Messaging (in system.messaging.dll)

public long LookupId { get; }
/** @property */
public long get_LookupId ()

public function get LookupId () : long

Property Value

The message's lookup identifier, which is generated by Message Queuing and is unique to the queue where the message resides.
Exception typeCondition

PlatformNotSupportedException

MSMQ 3.0 is not installed.

InvalidOperationException

The message has not been sent. This property can only be read on messages retrieved from a queue.

-or-

The message queue is filtered to ignore the LookupId property.

The LookupId property provides read-only access to a message's lookup identifier. The lookup identifier, introduced in MSMQ 3.0, is a 64-bit identifier that is generated by Message Queuing and assigned to each message when the message is placed in the queue. The lookup identifier is not the same as the message identifier that is generated when the message is sent.

Message Queuing generates a lookup identifier for all messages that are placed in any queue, including application-generated destination, administration, and report queues, as well as system-generated journal, dead-letter, connector, and outgoing queues. In other words, this includes both messages sent by sending applications and by Message Queuing. The lookup identifier is unique to the queue and has no meaning outside the queue.

If a message is sent to several destination queues, or if a copy of a message is stored in a computer journal or queue journal, each copy of the message will have its own lookup identifier when it is placed in its respective queue.

The LookupId property can only be read on messages retrieved from a queue.

A lookup identifier is used to read a specific message in the queue. Once the lookup identifier of a message is known, the receiving application can call the PeekByLookupId or ReceiveByLookupId function to go directly to that message and peek at or retrieve it from the queue, unlike cursors that must start at the front of the queue and navigate towards the end of the queue,

Obtaining the lookup identifiers of the messages in the queue is the responsibility of the application. One possible way to obtain the lookup identifiers is to create a trigger for the destination queue that invokes a component that caches the identifiers of each message as they are placed in the queue.

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.