PeekByLookupId(MessageLookupAction,Int64) Method
Introduced in MSMQ 3.0. Peeks at a specific message from the queue. The message can be specified by a lookup identifier or by its position at the front or end of the queue.
Syntax
'Declaration Public Overloads Function PeekByLookupId( _ ByVal action As MessageLookupAction, _ ByVal lookupId As Long _ ) As Message
'Usage Dim instance As MessageQueue Dim action As MessageLookupAction Dim lookupId As Long Dim value As Message value = instance.PeekByLookupId(action, lookupId)
public Message PeekByLookupId( MessageLookupAction action, long lookupId )
public: Message^ PeekByLookupId( MessageLookupAction action, int64 lookupId )
Parameters
- action
- One of the MessageLookupAction values, specifying how the message is read in the queue. Specify one of the following:MessageLookupAction.Current: Peeks at the message specified by lookupId.MessageLookupAction.Next: Peeks at the message following the message specified by lookupId.MessageLookupAction.Previous: Peeks at the message preceding the message specified by lookupId.MessageLookupAction.First: Peeks at the first message in the queue. The lookupId parameter must be set to 0.MessageLookupAction.Last: Peeks at the last message in the queue. The lookupId parameter must be set to 0.
- lookupId
- The LookupId of the message to peek at, or 0. 0 is used when accessing the first or last message in the queue.
Return Value
Exceptions
Exception | Description |
---|---|
System.PlatformNotSupportedException | MSMQ 3.0 is not installed. |
System.InvalidOperationException | The message with the specified lookupId could not be found. |
MessageQueueException | An error occurred when accessing a Message Queuing method. |
System.ComponentModel.InvalidEnumArgumentException | The action parameter is not one of the MessageLookupAction members. |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also