You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/12/31 09:21:34 UTC

[GitHub] [rocketmq] XiaoyiPeng opened a new issue #3687: Incorrect method[TransactionalMessageBridge#addRemoveTagInTransactionOp()] description may mislead others.

XiaoyiPeng opened a new issue #3687:
URL: https://github.com/apache/rocketmq/issues/3687


   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
       When I read the following code about transaction messages, I noticed a problem with the method comments.
    
   ```java
    /**
        * 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.
        */
       private boolean addRemoveTagInTransactionOp(MessageExt messageExt, MessageQueue messageQueue) {
           Message message = new Message(TransactionalMessageUtil.buildOpTopic(), TransactionalMessageUtil.REMOVETAG,
               String.valueOf(messageExt.getQueueOffset()).getBytes(TransactionalMessageUtil.charset));
           writeOp(message, messageQueue);
           return true;
       }
   ```
      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`.
   
      I debugged the codeļ¼Œas shown below:
   ![image](https://user-images.githubusercontent.com/8653312/147814486-3876eaa4-f0c6-4ccd-85f9-82ece59671e4.png)
   
   ![image](https://user-images.githubusercontent.com/8653312/147814497-4862883a-009c-4254-bafd-27b16e0b8387.png)
   
       This may mislead others unfamiliar with the code's logic.
   
   2. Please tell us about your environment:
   
        Windows 10.
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] XiaoyiPeng closed issue #3687: Incorrect comment of method[TransactionalMessageBridge#addRemoveTagInTransactionOp()] may mislead others.

Posted by GitBox <gi...@apache.org>.
XiaoyiPeng closed issue #3687:
URL: https://github.com/apache/rocketmq/issues/3687


   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org