ReceiveById(String,TimeSpan,MessageQueueTransactionType) Method
Receives the message that matches the given identifier and waits until either a message with the specified identifier is available in the queue or the time-out expires.
Syntax
'Declaration Public Overloads Function ReceiveById( _ ByVal id As String, _ ByVal timeout As TimeSpan, _ ByVal transactionType As MessageQueueTransactionType _ ) As Message
'Usage Dim instance As MessageQueue Dim id As String Dim timeout As TimeSpan Dim transactionType As MessageQueueTransactionType Dim value As Message value = instance.ReceiveById(id, timeout, transactionType)
public Message ReceiveById( string id, TimeSpan timeout, MessageQueueTransactionType transactionType )
public: Message^ ReceiveById( String^ id, TimeSpan timeout, MessageQueueTransactionType transactionType )
Parameters
- id
- The Id of the message to receive.
- timeout
- A System.TimeSpan that indicates the time to wait until a new message is available for inspection.
- transactionType
- One of the MessageQueueTransactionType values, describing the type of transaction context to associate with the message.
Return Value
Exceptions
Exception | Description |
---|---|
System.ArgumentNullException | The id parameter is null. |
System.ArgumentException | The value specified for the timeout parameter is not valid, possibly timeout is less than System.TimeSpan.Zero or greater than InfiniteTimeout. |
MessageQueueException | A message with the specified id did not arrive in the queue before the time-out expired.-or- An error occurred when accessing a Message Queuing method. |
System.ComponentModel.InvalidEnumArgumentException | The transactionType parameter is not one of the MessageQueueTransactionType 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