(Read-only, introduced in MSMQ 2.0.) The PROPID_M_XACTID property indicates which transaction sent the message.
VT_VECTOR | VT_UI1
Identifier of the transaction. See Remarks for a description of a transaction identifier.
This property is available for MSMQ 2.0 and later. It is used by receiving applications to verify that a message was sent from a specific transaction. The transaction identifier is a 20-byte identifier that includes the computer identifier of the sending machine (first 16 bytes) followed by a transaction sequence number (4 bytes).
Transaction identifiers are not guaranteed to be unique because the transaction sequence numbers are not persistent and they start over again at 2^20. Message Queuing guarantees only that successive transactions will have different transaction sequence numbers.
You can use PROPID_M_XACTID along with two other properties to verify transaction boundaries. These two properties are properties for identifying the first and last message sent in a transaction: PROPID_M_FIRST_IN_XACT and PROPID_M_LAST_IN_XACT.
To retrieve the transaction identifier of a message, specify PROPID_M_XACTID and a buffer consisting of 20 unsigned characters to receive its value in the MQMSGPROPS structure.
|The buffer must consist of exactly 20 unsigned characters. Specifying either a smaller or larger buffer will result in an error.|
Equivalent COM Property
With COM components, the equivalent property for retrieving the transaction identifier is MSMQMessage.TransactionId.
|For information on||See|
How transaction boundaries can be used
Identifying the first message in the transaction
Identifying the last message in the transaction
The following code fragment shows how PROPID_M_XACTID is specified in arrays that can be used to initialize an MQMSGPROPS structure.
UCHAR rgucXactID[PROPID_M_XACTID_SIZE]; aMsgPropId[i] = PROPID_M_XACTID; // Property ID aPropVar[i].vt = VT_VECTOR | VT_UI1; // Type indicator aPropVar[i].caub.pElems = rgucXactID; aPropVar[i].caub.cElems = PROPID_M_XACTID_SIZE; i++;
The following example is included in Using Message Queuing.
|For an example of||See|
Identifying the first and last messages in a transaction