PROPID_M_CORRELATIONID

This property specifies the correlation identifier of the message.

  • Type Indicator
    VT_VECTOR | VT_UI1
  • PROPVARIANT Field
    caub
  • Property Values
    Application-defined message identifier (default is 0). Maximum length is 20 bytes.

Remarks

When sending a message, PROPID_M_CORRELATIONID provides an application-defined identifier that the receiving application can use to sort messages.

To set the correlation identifier of a message, specify PROPID_M_CORRELATIONID in the MQMSGPROPS structure and call MQSendMessage.

To retrieve the correlation identifier of a message, specify PROPID_M_CORRELATIONID **** in the MQMSGPROPS structure. Then call MQReceiveMessage and examine its returned value.

When sending response messages to the sending application, PROPID_M_CORRELATIONID can be set to the message identifier (PROPID_M_MSGID) 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 message, it uses the PROPID_M_CORRELATIONID property to specify the message identifier of the original message. The application retrieving the acknowledgment messages can then use PROPID_M_CORRELATIONID to identify the original message associated with the acknowledgment message.

When sending messages to a foreign queue, the value of PROPID_M_CORRELATIONID is used to verify the sender's signature.

Example

This example shows how PROPID_M_CORRELATIONID is specified in the MQMSGPROPS structure.

UCHAR szCorrelationID[20];
aMsgPropId[i] = PROPID_M_CORRELATION;      // Property ID
aMsgPropVar[i].vt = VT_VECTOR | VT_UI1; // Type indicator
aMsgPropVar[i].caub.pElems = szCorrelationID;
aMsgPropVar[i]..caub.cElems = sizeof(szCorrelationID);
i++;

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later. Versions prior to 2.12 require the MSMQ add-on pack. Mq.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

MQReceiveMessage, MQSendMessage, PROPID_M_MSGID, MQMSGPROPS

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.