Interface AmqpTransactionCoordinator


public interface AmqpTransactionCoordinator
Provides an API to manage AMQP transaction on the message broker. A transaction is used where two or more operations in the messaging broker are part of one unit of work. The transaction must ensure that all operations belonging to a given transaction either succeed or fail jointly. In general a transaction is involved with many operations on one message broker entity. Sometime a transaction can span over multiple message broker entities explained as follows.

Distributed Transactions: A distributed transaction where operations spans over different message broker entities. For example an application receive from entity 'A' and sends to entity 'B' and 'C' and all these operations are part of one transaction.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    This creates the transaction on the message broker.
    discharge(AmqpTransaction transaction, boolean isCommit)
    This completes the transaction on the message broker.
  • Method Details

    • discharge

      Mono<Void> discharge(AmqpTransaction transaction, boolean isCommit)
      This completes the transaction on the message broker. All the operations belonging to this transaction will either rollback or committed as one unit of work.
      Parameters:
      transaction - that needs to be completed on the message broker.
      isCommit - this flag indicates that the operations associated with this transaction should commit or rollback.
      Returns:
      a completable Mono.
    • declare

      Mono<AmqpTransaction> declare()
      This creates the transaction on the message broker. Successful completion of this API indicates that a transaction identifier has successfully been created on the message broker. Once a transaction has been created, it must be completed by using discharge(AmqpTransaction, boolean) API.
      Returns:
      the created transaction id represented by AmqpTransaction.