ReceiveByCorrelationId(String,MessageQueueTransactionType) Method
Receives the message that matches the given correlation identifier and immediately raises an exception if no message with the specified correlation identifier currently exists in the queue.
Syntax
'Declaration Public Overloads Function ReceiveByCorrelationId( _ ByVal correlationId As String, _ ByVal transactionType As MessageQueueTransactionType _ ) As Message
'Usage Dim instance As MessageQueue Dim correlationId As String Dim transactionType As MessageQueueTransactionType Dim value As Message value = instance.ReceiveByCorrelationId(correlationId, transactionType)
public Message ReceiveByCorrelationId( string correlationId, MessageQueueTransactionType transactionType )
public: Message^ ReceiveByCorrelationId( String^ correlationId, MessageQueueTransactionType transactionType )
Parameters
- correlationId
- The CorrelationId of the message to receive.
- 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 correlationId parameter is null. |
System.InvalidOperationException | The message with the specified correlationId could not be found. |
System.ComponentModel.InvalidEnumArgumentException | The transactionType parameter is not one of the MessageQueueTransactionType members. |
MessageQueueException | 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