Transactions

    以下概念可以帮助你了解 Pulsar 事务。

    事务调度器负责维护在事务中互相关联的主题和订阅信息。 事务提交后,事务调度器与主题所在的broker交互完成事务。

    The transaction coordinator handles transaction timeout, and ensures that the transaction is aborted after a transaction timeout.

    All the transaction metadata is persisted in the transaction log. The transaction log is backed by a Pulsar topic. After the transaction coordinator crashes, it can restore the transaction metadata from the transaction log.

    Messages produced within a transaction are stored in the transaction buffer. The messages in transaction butter are not materialized (visible) to consumers until the transactions are committed. The messages in the transaction buffer are discarded when the transactions are aborted.

    Message acknowledges within a transaction are maintained by the pending acknowledge state before the transaction completes. If a message is in the pending acknowledge state, the message cannot be acknowledged by other transactions until the message is removed from the pending acknowledge state.