ReceiveByCorrelationId(String,MessageQueueTransaction) Method
Receives the message that matches the given correlation identifier (from a transactional queue) 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 transaction As MessageQueueTransaction _ ) As Message
'Usage Dim instance As MessageQueue Dim correlationId As String Dim transaction As MessageQueueTransaction Dim value As Message value = instance.ReceiveByCorrelationId(correlationId, transaction)
public Message ReceiveByCorrelationId( string correlationId, MessageQueueTransaction transaction )
public: Message^ ReceiveByCorrelationId( String^ correlationId, MessageQueueTransaction^ transaction )
Parameters
- correlationId
- The CorrelationId of the message to receive.
- transaction
- The MessageQueueTransaction object.
Return Value
Exceptions
Exception | Description |
---|---|
System.ArgumentNullException | The correlationId parameter is null.-or- The transaction parameter is null. |
System.InvalidOperationException | The message with the specified correlationId could not be found. |
MessageQueueException | The queue is non-transactional.-or- 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