Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This property identifies the message using a 20-byte, correlation identifier.

Syntax

HRESULT get_CorrelationId( 
  VARIANT* 
pvarMsdId 
);
HRESULT put_CorrelationId( 
  VARIANT 
varMsgId 
);

Parameters

pvarMsdIdor varMsgId

A 20-byte application-defined correlation identifier.

Return Value

The following table describes the common return values.

Value Description

S_OK

Success

E_INVALIDARG

One or more arguments are invalid

E_NOTIMPL

The function contains no implementation

E_OUTOFMEMORY

Out of memory

Remarks

CorrelationIdprovides an application-defined identifier that the receiving application can use to sort messages.

The correlation identifier must be a 20-byte identifier. If the correlation identifier is not 20bytes, an MQ_ERROR_ILLEGAL_PROPERTY_SIZE error is returned when the message is sent.

When sending response messages back to the sending application, the CorrelationIdproperty of the response message can be set to the message identifier ( MSMQMessage.Id) of the original message that is in the queue. This provides an easy mechanism that the sending application can use to match the response message with the original message that was sent.

When Message Queuing generates an acknowledgment message or report message, it uses the CorrelationIdproperty to return the message identifier of the original message. The application reading the acknowledgment or report message can then look at the CorrelationIdproperty to find the message identifier of the original message that was sent.

When generating acknowledgment and report messages, connector applications must set the correlation identifier of the acknowledgment and report messages to the message identifier of the original message.

Equivalent Function property

When using functions, the correlation identifier of the message can be set and retrieved using the PROPID_M_CORRELATIONIDproperty.

Requirements

Header mqoai.h
Library mqoa.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also