PROPID_Q_TRANSACTION

Optional. The PROPID_Q_TRANSACTION property specifies whether the queue is a transaction queue or a non-transaction queue.

Type Indicator
VT_UI1
PROPVARIANT Field
bVal
Property Values
This property can be set to one of the following values:
MQ_TRANSACTIONAL
All messages sent to the queue must come through an MSMQ transaction.
MQ_TRANSACTIONAL_NONE
The default. No transaction operations can be performed on the queue.

Remarks

If a queue is transactional, it can accept only messages that are sent as part of a transaction (see MQSendMessage). However, messages can be retrieved from a local transaction queue with or without using a transaction (see MQReceiveMessage).

For information on how MSMQ performs transactions, see MSMQ Transactions.

To create a transaction queue, specify PROPID_Q_TRANSACTION in the MQQUEUEPROPS structure and call MQCreateQueue.

PROPID_Q_TRANSACTION cannot be changed once the queue is created. If an attempt is made to set it afterward, an MQ_ERROR_PROPERTY error is returned to the call, and the property's associated aStatus entry will contain MQ_PROPERTY_NOTALLOWED.

To find out if the queue is a transaction queue, specify PROPID_Q_TRANSACTION in the MQQUEUEPROPS structure and call MQGetQueueProperties and examine its returned value.

Example

This example shows how PROPID_Q_TRANSACTION is specified in the MQQUEUEPROPS structure for both setting and retrieving this property.

//To set PROPID_Q_TRANSACTION
aPropID[i] = PROPID_Q_TRANSACTION;        // Property identifier
aVariant[i].vt = VT_UI1;                  // Type indicator
aVariant[i].bVal = MQ_TRANSACTION;        // Creates transaction queue
i++

//To retrieve PROPID_Q_TRANSACTION
aPropID[i] = PROPID_Q_TRANSACTION;       // Property identifier
aVariant[i].vt = VT_UI1;                 // Type indicator
i++
 
For complete examples of… See…
Creating a public or private queue Creating a Queue
Retrieving the transaction level of the queue Retrieving PROPID_Q_TRANSACTION

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mq.h.
  Import Library: Use mqrt.lib.
  Unicode: Defined only as Unicode.

See Also

MQCreateQueue, MQGetQueueProperties, MQReceiveMessage, MQSendMessage