NOTE
2.12 RocketMQ Transaction Messages
1. What Are RocketMQ Transaction Messages - Traditional local message tables depend on a message table in the database. - RocketMQ transactions encapsulate the local-message-table approach by moving the local message table into MQ, solving the atomicity problem between Producer-side message sending and local transaction execution.
This is a historical learning note and may contain outdated or incomplete understanding.
1. What Are RocketMQ Transaction Messages?
- Traditional local message tables depend on a message table in the database.
- RocketMQ transactions encapsulate the local-message-table approach by moving the local message table into MQ, solving the atomicity problem between Producer-side message sending and local transaction execution.
2. How RocketMQ Transaction Messages Work

- Service A sends a half message to MQ.
- Service A receives MQ’s confirmation for the half message.
- Service A executes the local transaction.
- Service A sends a commit/rollback message to MQ according to the execution result of the local transaction.
- If the confirmation message in step 2 is lost, or execution of the local transaction in step 3 times out, MQ sends the half-message confirmation to Service A again.
- Service A checks the local transaction status.
- Service A sends a commit/rollback message to MQ according to the local transaction status.
- After MQ receives a commit message, it sends the message to Service B. If it receives a rollback message, it discards the message.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub