System.Messaging Reference (Document! X Sample)
ReceiveById(String,MessageQueueTransactionType) Method



System.Messaging Namespace > MessageQueue Class > ReceiveById Method : ReceiveById(String,MessageQueueTransactionType) Method
The Id of the message to receive.
One of the MessageQueueTransactionType values, describing the type of transaction context to associate with the message.
Receives the message that matches the given identifier and immediately raises an exception if no message with the specified identifier currently exists in the queue.
Syntax
'Declaration
 
Public Overloads Function ReceiveById( _
   ByVal id As String, _
   ByVal transactionType As MessageQueueTransactionType _
) As Message
'Usage
 
Dim instance As MessageQueue
Dim id As String
Dim transactionType As MessageQueueTransactionType
Dim value As Message
 
value = instance.ReceiveById(id, transactionType)

Parameters

id
The Id of the message to receive.
transactionType
One of the MessageQueueTransactionType values, describing the type of transaction context to associate with the message.

Return Value

The Message whose Id property matches the id parameter passed in.
Exceptions
ExceptionDescription
The id parameter is null.
The message with the specified id could not be found.
The transactionType parameter is not one of the MessageQueueTransactionType members.
An error occurred when accessing a Message Queuing method.
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

Reference

MessageQueue Class
MessageQueue Members
Overload List