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/10/28 11:19:41 UTC

[GitHub] [rocketmq] HScarb removed a comment on issue #3438: Statistics topic may wrong when CommitLog putting a delay message

HScarb removed a comment on issue #3438:
URL: https://github.com/apache/rocketmq/issues/3438#issuecomment-953749404


   > > > Someone has fixed it, you can see #2684
   > > 
   > > 
   > > I see, but the `topic` variable problem still remains
   > 
   > The two values of topic and msg.getTopic() are the same
   
   The delay message logic will modify the `topic` value to `SCHEDULE_TOPIC_XXXX`, and is not same as `msg.getTopic()`
   
   ```java
           String topic = msg.getTopic();
           int queueId = msg.getQueueId();
   
           final int tranType = MessageSysFlag.getTransactionValue(msg.getSysFlag());
           if (tranType == MessageSysFlag.TRANSACTION_NOT_TYPE
                   || tranType == MessageSysFlag.TRANSACTION_COMMIT_TYPE) {
               // Delay Delivery
               if (msg.getDelayTimeLevel() > 0) {
                   if (msg.getDelayTimeLevel() > this.defaultMessageStore.getScheduleMessageService().getMaxDelayLevel()) {
                       msg.setDelayTimeLevel(this.defaultMessageStore.getScheduleMessageService().getMaxDelayLevel());
                   }
   
                   // !!! here modifies the topic value
                   topic = TopicValidator.RMQ_SYS_SCHEDULE_TOPIC;
                   queueId = ScheduleMessageService.delayLevel2QueueId(msg.getDelayTimeLevel());
   
                   // Backup real topic, queueId
                   MessageAccessor.putProperty(msg, MessageConst.PROPERTY_REAL_TOPIC, msg.getTopic());
                   MessageAccessor.putProperty(msg, MessageConst.PROPERTY_REAL_QUEUE_ID, String.valueOf(msg.getQueueId()));
                   msg.setPropertiesString(MessageDecoder.messageProperties2String(msg.getProperties()));
   
                   msg.setTopic(topic);
                   msg.setQueueId(queueId);
               }
           }
   ```


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