The CorrelationId property identifies the message using a 20-byte, correlation identifier.
Type: | Variant (array of bytes) |
Run time: | read/write |
object.CorrelationId
Syntax Element | Description |
---|---|
object | Message (MSMQMessage) object that defines the message. |
A 20-byte application-defined correlation identifier.
CorrelationId provides an application-defined identifier that the receiving application can use to sort messages.
When sending response messages to the sending application, CorrelationId can be set to the message identifier (Id) of the message that is in the queue. This provides an easy mechanism that the sending application can use to match the response message with the message that was sent.
When MSMQ generates an acknowledgment or report message, it uses the CorrelationId property to specify the message identifier of the original message. The application can then look at the CorrelationId property to find the message identifier of the original message.
Note MSMQ Connector applications must also set the correlation identifier of the acknowledgment and report messages to the message identifier of the original message.
Windows NT: Requires version 4.0 SP3 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mqoai.h.
Import Library: Use mqoa.lib.
Unicode: Defined only as Unicode.