tencent cloud

Feedback

Transactional Message

Last updated: 2024-01-17 16:52:56
    This document describes the concept, technical principle, use cases, and application scenarios of transactional messages in TDMQ for RocketMQ.

    Feature Description

    The transactional message solves the atomicity problem of local transaction execution and message sending, ensuring the eventual consistency between them. It provides users with the distributed transaction feature similar to X/Open XA, so users can achieve the eventual consistency of the distributed transaction in TDMQ for RocketMQ.
    
    1. The producer sends a message to RocketMQ (1).
    2. After receiving the message, the server stores it in the half message topic (2).
    3. Local transaction is executed (3).
    4. The producer proactively sends the transaction execution result to TDMQ for RocketMQ (4).
    5. If the local transaction execution result has not been returned after a certain period of time, TDMQ for RocketMQ will execute the recheck logic (5).
    6. After receiving the message recheck, the producer needs to check the final result of the local transaction execution of the corresponding message and give feedback (6, 7). There are three transaction execution status:
    TransactionStatus.COMMIT: Commits the transaction. Consumers can consume the message.
    TransactionStatus.ROLLBACK: Rolls back the transaction. The message is discarded without being consumed by consumers.
    TransactionStatus.UN_KNOW: Unknown status, indicating the waiting of another recheck.
    7. When the transaction is successfully executed, TDMQ for RocketMQ submits the transactional message to the real topic for consumption by consumers (a).

    Use Cases

    The transaction messages of TDMQ for RocketMQ can be used to process transactions, which can greatly improve processing efficiency and performance. A billed transaction chain is usually long with a significant chance of error or timeout. TDMQ for RocketMQ's automated repush and abundant message retention features can be used to provide transaction compensation, and the eventual consistency of payment tips notifications and transaction pushes can also be achieved through TDMQ for RocketMQ.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support