System.Messaging Reference (Document! X Sample)



System.Messaging Namespace > Message Class : CorrelationId Property
CorrelationId Property (Message)
Gets or sets the message identifier used by acknowledgment, report, and response messages to reference the original message.
Syntax
'Declaration
 
<MessagingDescriptionAttribute("Provides an application-defined identifier that the receiving application can use to sort messages.")>
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)>
<ReadOnlyAttribute(True)>
Public Property CorrelationId As String
'Usage
 
Dim instance As Message
Dim value As String
 
instance.CorrelationId = value
 
value = instance.CorrelationId
[MessagingDescription("Provides an application-defined identifier that the receiving application can use to sort messages.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[ReadOnly(true)]
public string CorrelationId {get; set;}
[MessagingDescription("Provides an application-defined identifier that the receiving application can use to sort messages.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[ReadOnly(true)]
public:
property String^ CorrelationId {
   String^ get();
   void set (    String^ value);
}

Property Value

The message identifier specified by the Id property of the original message. The correlation identifier is used by Message Queuing when it generates an acknowledgment or report message, and by an application when it generates a response message.
Exceptions
ExceptionDescription
The message queue is filtered to ignore the CorrelationId property.
The CorrelationId is null.
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