XiaoFeiASK opened a new pull request, #1125: URL: https://github.com/apache/incubator-seata-go/pull/1125
- [x] I have registered the PR [changes](https://github.com/apache/incubator-seata-go/tree/master/changes). **What this PR does**: This PR integrates the `END_TRANSACTION` protocol adaptation into the TCC RocketMQ mode, enabling immediate Commit/Rollback notifications to the Broker and eliminating the reliance on the 60-second checkback mechanism. 1. **EndTransactionSender** — Core protocol implementation - Manually constructs the RocketMQ Remoting protocol `END_TRANSACTION` request (`RequestCode=37`) and sends Commit/Rollback instructions directly to the Broker via TCP. - Includes NameServer routing query (`RequestCode=105`) to automatically resolve the Broker master node address. 2. **TccRocketMQAction** — Changes TCC phase-two behavior from "no-op" to "active notification + checkback fallback" - `Commit()`: Constructs the `END_TRANSACTION` request (`commitOrRollback=8`) and notifies the Broker to commit the half message via `sendEndTransaction()`. On failure, it logs a warning, returns `true`, and falls back to the Broker checkback. - `Rollback()`: Constructs the `END_TRANSACTION` request (`commitOrRollback=12`) and notifies the Broker to roll back the half message via `sendEndTransaction()`. On failure, it similarly falls back to the checkback. - `buildEndTransactionHeader()`: Extracts metadata such as `offsetMsgId`, `brokerName`, `topic`, and `queueOffset` from `ActionContext`, and parses `CommitLogOffset`. 3. **TransactionListener** — Corrects global status mapping - Changes `GlobalStatusCommitFailed` to return `UnknownState`, preventing the Broker from directly rolling back during checkback and allowing the TC to continue commit retries. 4. **TCCServiceProxy** — Adds delayed reporting for `ActionContext` - After a successful Prepare phase, it writes message metadata (`msgId`, `brokerName`, `topic`, etc.) back to the TC via `BranchReport`, ensuring the phase-two Commit/Rollback can access the Broker address information. **Which issue(s) this PR fixes?** Related to #765 **Special notes for your reviewer**: **Does this PR introduce a user-facing change?**: ```release-note Add RocketMQ TCC integration support for distributed transaction messaging -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
