wang-jiahua opened a new pull request, #10564:
URL: https://github.com/apache/rocketmq/pull/10564

   ### Which Issue(s) This PR Fixes
   
   Fixes #9791
   
   ### Brief Description
   
   When multiple producers in the same group handle different topics, the 
transaction check may be routed to an unrelated producer that cannot determine 
the transaction state correctly.
   
   Fix: Record the original producer's clientId in the half message properties. 
During transaction check-back, prefer the channel matching that clientId. Fall 
back to round-robin if the original producer is offline.
   
   ### How Did You Implement It
   
   - `MessageConst`: add `PROPERTY_TRANSACTION_PRODUCER_CLIENT_ID`
   - `DefaultMQProducerImpl`: write clientId into half message
   - `ProducerManager`: add `getAvailableChannel(groupId, preferredClientId)`
   - `AbstractTransactionalMessageCheckListener` + 
`TransactionalMessageRocksDBService`: use new method
   
   ### How to Verify It
   
   Unit tests: `ProducerManagerTest` (3 new test cases covering match, 
fallback, and null clientId).
   Fully backward compatible: old producers without clientId property fall back 
to round-robin.


-- 
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]

Reply via email to