You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I read the following code about transaction messages, I noticed a problem with the method comments in class TransactionalMessageBridge.
/** * Use this function while transaction msg is committed or rollback write a flag 'd' to operation queue for the * msg's offset * * @param messageExt Op message * @param messageQueue Op message queue * @return This method will always return true. */privatebooleanaddRemoveTagInTransactionOp(MessageExtmessageExt, MessageQueuemessageQueue) {
Messagemessage = newMessage(TransactionalMessageUtil.buildOpTopic(), TransactionalMessageUtil.REMOVETAG,
String.valueOf(messageExt.getQueueOffset()).getBytes(TransactionalMessageUtil.charset));
writeOp(message, messageQueue);
returntrue;
}
But in fact:
The param messageExt of the method is half message instead of Op message.
The param messageQueue of the method is half message queue instead of Op message queue.
To prove my point, I debugged the code,as shown below:
This may mislead others unfamiliar with the code's logic.