PROPID_M_LAST_IN_XACT (Compact 2013)

3/26/2014

This property indicates whether the message was the last 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.

Property Value

This property can be set to one of the following values:

Value

Description

MQMSG_LAST_IN_XACT

The message was the last message sent in the transaction.

MQMSG_NOT_LAST_IN_XACT

The message was not the last message sent in the transaction.

Remarks

The PROPID_M_LAST_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 last message sent from a single transaction to a single queue.

To verify transaction boundaries, use PROPID_M_LAST_IN_XACT with the following properties:

If only one message is sent in a transaction, PROPID_M_FIRST_IN_XACT and PROPID_M_LAST_IN_XACT are set.

Examples

The following code example shows how PROPID_M_LAST_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_LAST_IN_XACT;  // Property ID
aPropVar[i].vt = VT_UI1;             // Type indicator
i++;
...

msgprops.aPropVar = aMsgPropVar;
...

MQReceiveMessage(hQueue, ..., &msgprops, ...);

...
i++;
if(aMsgPropVar[i].bVal == MQMSG_LAST_IN_XACT)
{
   

See Also

Reference

MSMQ Properties
PROPID_M_FIRST_IN_XACT
PROPID_M_XACTID