liujian16 opened a new issue #1838: New Programming Model of TransactionMQProducer URL: https://github.com/apache/rocketmq/issues/1838 Under current design, LocalTransaction is executed after half message is successfully sent. A LocalTransaction may takes long time to complete, and while it is running , TransactionCheckerListener may be called to report the status of the transaction. It's very hard or even impossible for the TransactionCheckerListener to distinguish whether the transaction is on-going or is rollbacked. I'd propose a new programming model of TransactionMQProducer. 1. Start local transaction 2. execute local transaction logic 3. Call TransactionMQProducer to send half message and record `SendResult` 4. Commit or Rollback local transaction based on SendResult. 5. Tell MQ the local transaction state. According to this design, there is no extract work to do after half message is sent, TransactionCheckerListener can be confident the transaction is rollbacked if it can find a record in the database. And Step 5 can be easily implemented using Spring Transaction bound event.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
