PROPID_M_XACTID
A version of this page is also available for
4/8/2010
This property indicates which transaction sent the message.
- Property ID
PROPID_M_XACTID
- Type Indicator
VT_VECTOR | VT_UI1
- MQPROPVARIANT Field
caub
Property Values
Identifier of the transaction.For a description of a transaction identifier, see the Remarks section.
Remarks
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 following:
- The computer identifier of the sending machine (the first 16 bits)
- A transaction sequence number (the last 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 subsequent transactions will have different transaction sequence numbers.
To verify transaction boundaries, use PROPID_M_XACTID with the following properties:
- PROPID_M_FIRST_IN_XACT, which checks the first message sent in a transaction
- PROPID_M_LAST_IN_XACT, which checks the last message sent in a transaction
Examples
The following code example shows how PROPID_M_XACTID is specified in the MQMSGPROPS structure.
DWORD dwIdBufferSize = 1024;
UCHAR *pucIdBuffer = (UCHAR *)malloc(dwIdBufferSize);
if (pucIdBuffer == NULL) {
// Error handling code (not included for clarity)
}
aMsgPropId[i] = PROPID_M_XACTID; // Property ID
aPropVar[i].vt = VT_VECTOR|VT_UI1; // Type indicator
aPropVar[i].caub.pElems = (UCHAR*)pucIdBuffer;
aPropVar[i].caub.cElems = dwIdBufferSize;
i++;