tencent cloud

Feedback

Transactional Message

Last updated: 2023-04-14 16:59:12
    This document describes the concept, technical principle, use cases, and usage methods of transactional messages in the TDMQ for RocketMQ.

    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 the message in the half message topic (2).
    3. Local transaction execution is done (3).
    4. The producer actively sends the transaction execution result to RocketMQ (4).
    5. If the local transaction execution result has not been returned after a certain period of time, RocketMQ will execute the checkback logic (5).
    6. After receiving the message checkback, 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, and consumers can consume the message.
    TransactionStatus.ROLLBACK: Rolls back the transaction, and the message is discarded without being consumed by consumers.
    TransactionStatus.UN_KNOW: Unknown status, indicating the waiting of another checkback.
    7. When the transaction is successfully executed, 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 billing system often has a long transaction linkage with a significant chance of error or timeout. TDMQ'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.
    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