Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Modernization
Samples

Transaction support

Component: IBM MQ Transport
NuGet Package: NServiceBus.Transport.IBMMQ 1.x
Target Version: NServiceBus 10.x

The IBM MQ transport supports the following transport transaction modes:

  • Transport transaction - Sends atomic with receive
  • Transport transaction - Receive only (default)
  • Unreliable (transactions disabled)

TransactionScope mode is not supported because the IBM MQ .NET client does not participate in distributed transactions.

Sends atomic with receive

In SendsAtomicWithReceive mode, the message receive and all outgoing send/publish operations are committed or rolled back as a single unit of work.

var transport = new IBMMQTransport
{
    // ... connection settings ...
    TransportTransactionMode = TransportTransactionMode.SendsAtomicWithReceive
};

Receive only

In ReceiveOnly mode, the message receive is transactional. Successfully processed messages are committed; failed messages are returned to the queue. Outgoing send and publish operations are not part of the receive transaction.

This is the default transaction mode.

var transport = new IBMMQTransport
{
    // ... connection settings ...
    TransportTransactionMode = TransportTransactionMode.ReceiveOnly
};

Unreliable (transactions disabled)

In None mode, messages are consumed without any transactional guarantees. If processing fails, the message is lost.

var transport = new IBMMQTransport
{
    // ... connection settings ...
    TransportTransactionMode = TransportTransactionMode.None
};