wang-jiahua commented on code in PR #10564:
URL: https://github.com/apache/rocketmq/pull/10564#discussion_r3878050989
##########
client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java:
##########
@@ -1444,6 +1445,7 @@ public TransactionSendResult
sendMessageInTransaction(final Message msg,
SendResult sendResult = null;
MessageAccessor.putProperty(msg,
MessageConst.PROPERTY_TRANSACTION_PREPARED, "true");
MessageAccessor.putProperty(msg, MessageConst.PROPERTY_PRODUCER_GROUP,
this.defaultMQProducer.getProducerGroup());
+ MessageAccessor.putProperty(msg,
MessageConst.PROPERTY_TRANSACTION_PRODUCER_CLIENT_ID,
this.mQClientFactory.getClientId());
Review Comment:
Following up on my earlier reply: that first fix was actually incomplete —
it cleared the property from the map only, after `endMessageTransaction()` had
already encoded `propertiesString`, so the hint still reached the wire data.
Fixed properly in 42302fe6e: the clear now happens inside
`endMessageTransaction()` before encoding, and a new test asserts the committed
message carries the hint in neither the property map nor the encoded
`propertiesString`. About `buildTransactionalMessageFromHalfMessage()`: its
only production caller is `EscapeBridge`, which migrates a half message to
another broker — the rebuilt message re-enters the half topic there
(PREPARED=true), never reaches consumers, and the transaction-check routing
still needs the hint after migration, so the hint is intentionally kept on that
path. Added a test pinning that behavior as well.
--
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]