MessageQueue::ReceiveByLookupId Method (Int64)
Introduced in MSMQ 3.0. Receives the message that matches the given lookup identifier from a non-transactional queue.
Assembly: System.Messaging (in System.Messaging.dll)
Parameters
- lookupId
-
Type:
System::Int64
The LookupId of the message to receive.
Return Value
Type: System.Messaging::Message^The Message whose LookupId property matches the lookupId parameter passed in.
| Exception | Condition |
|---|---|
| PlatformNotSupportedException | MSMQ 3.0 is not installed. |
| InvalidOperationException | The message with the specified lookupId could not be found. |
| MessageQueueException | An error occurred when accessing a Message Queuing method. |
Use this method to read a message with a known lookup identifier and remove it from the queue. This method throws an exception immediately if the message is not in the queue.
The LookupId property of a message is unique to the queue where the message resides, so there will be at most one message in the queue that matches the given lookupId parameter.
To read a message with a specified lookup identifier without removing it from the queue, use the M:System.Messaging.MessageQueue.PeekByLookupId method.
The following table shows whether this method is available in various Workgroup modes.
Workgroup mode | Available |
|---|---|
Local computer | Yes |
Local computer and direct format name | Yes |
Remote computer | No |
Remote computer and direct format name | Yes |
Available since 2.0
LookupId
M:System.Messaging.MessageQueue.PeekByLookupId
ReceiveByLookupId Overload
MessageQueue Class
System.Messaging Namespace