PROPID_M_FIRST_IN_XACT (Compact 2013)
3/26/2014
This property indicates whether the message was the first message sent in a transaction.
When you specify this property in aPropID, set the following values for aPropVar:
- MQPROPVARIANT.vt
VT_UI1
- MQPROPVARIANT.bVal
The value of the property.
This property can be set to one of the following values:
Value |
Description |
---|---|
MQMSG_FIRST_IN_XACT |
The message was the first message sent in the transaction. |
MQMSG_NOT_FIRST_IN_XACT |
The message was not the first message sent in the transaction. |
The PROPID_M_FIRST_IN_XACT property is available for MSMQ 2.0, MSMQ 3.0, and MSMQ 4.0.
It is used by receiving applications to verify that a message was the first message sent in a single transaction to a single queue.
To verify transaction boundaries, use PROPID_M_FIRST_IN_XACT with the following properties:
- PROPID_M_LAST_IN_XACT, which is a property for checking the last message sent in a transaction
- PROPID_M_XACTID, which is a property for retrieving the identifier of the transaction
If only one message is sent in a transaction, PROPID_M_FIRST_IN_XACT and PROPID_M_LAST_IN_XACT are set.
The following code example shows how PROPID_M_FIRST_IN_XACT is specified in the MQMSGPROPS structure.
Important
For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.
aPropId[i] = PROPID_M_FIRST_IN_XACT; // Property ID
aPropVar[i].vt = VT_UI1; // Type indicator
// Call MQReceiveMessage to read messages in the queue
if(aPropVar[i].bVal == MQMSG_FIRST_IN_XACT)
{
// insert code
}