RongtongJin commented on code in PR #10564:
URL: https://github.com/apache/rocketmq/pull/10564#discussion_r3510151029
##########
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:
This adds an internal routing hint to the half message, but the committed
transactional message paths copy all half-message properties into the final
message and only clear the existing transaction routing fields. That means
consumers can observe `__TXN_PRODUCER_CID__`, which changes the user-visible
message property surface and may expose producer client identity. Please remove
`MessageConst.PROPERTY_TRANSACTION_PRODUCER_CLIENT_ID` when building the final
committed message, including both
`EndTransactionProcessor.endMessageTransaction()` and
`TransactionalMessageUtil.buildTransactionalMessageFromHalfMessage()`, and add
tests that verify the half message keeps this hint while the committed message
does not.
--
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]