File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ const (
5959 PropertyTranscationCheckTimes = "TRANSACTION_CHECK_TIMES"
6060 PropertyCheckImmunityTimeInSeconds = "CHECK_IMMUNITY_TIME_IN_SECONDS"
6161 PropertyShardingKey = "SHARDING_KEY"
62+ PropertyTransactionID = "__transactionId__"
6263)
6364
6465type Message struct {
Original file line number Diff line number Diff line change @@ -462,13 +462,20 @@ func (tp *transactionProducer) checkTransactionState() {
462462 if uniqueKey == "" {
463463 uniqueKey = callback .Msg .MsgId
464464 }
465+ transactionId := callback .Msg .GetProperty (primitive .PropertyTransactionID )
466+ if transactionId == "" {
467+ transactionId = callback .Header .TransactionId
468+ }
469+ if transactionId == "" {
470+ transactionId = callback .Msg .TransactionId
471+ }
465472 header := & internal.EndTransactionRequestHeader {
466473 CommitLogOffset : callback .Header .CommitLogOffset ,
467474 ProducerGroup : tp .producer .group ,
468475 TranStateTableOffset : callback .Header .TranStateTableOffset ,
469476 FromTransactionCheck : true ,
470477 MsgID : uniqueKey ,
471- TransactionId : callback . Header . TransactionId ,
478+ TransactionId : transactionId ,
472479 CommitOrRollback : tp .transactionState (localTransactionState ),
473480 }
474481
You can’t perform that action at this time.
0 commit comments