Partager via


Single-Message Transactions

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

Message Queuing provides an implicitly invoked internal transaction that includes a single operation performed on a single message and is called a single-message transaction. A single-message transaction can be used to request guaranteed exactly-once delivery (EOD) of a single message sent to a transactional queue.

Note

A request to retrieve a message in a single-message transaction using MQ_SINGLE_MESSAGE is equivalent to a request to retrieve a single message from a transactional queue in a nontransactional operation using MQ_NO_TRANSACTION.

A single-message transaction is a special case of a Message Queuing internal transaction and, for that reason, cannot participate in a transaction with other resource managers. Each single-message transaction is a separate transaction over which the programmer has no explicit commit/abort control.

The single-message transaction provides the best performance of all transaction types for sending a message. In addition to exactly-once delivery (EOD), a single-message transaction is faster than an external transaction, and the code used to send the message is very simple. The sending application only needs to make sure that the destination queue is transactional and that the transaction parameter is set to MQ_SINGLE_MESSAGE.

For an example of See
Sending a message in a single-message transaction C/C++ Code Example: Sending a Message Using a Single-Message Transaction

 Visual Basic Code Example: Sending a Message Using a Single-Message Transaction