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 2019/11/04 15:35:07 UTC

[GitHub] [rocketmq] YuShanMuGong opened a new pull request #1570: [ISSUE #1561]support specify msg level reconsume times

YuShanMuGong opened a new pull request #1570: [ISSUE #1561]support specify msg level reconsume times
URL: https://github.com/apache/rocketmq/pull/1570
 
 
   ## What is the purpose of the change
   能够针对消息级别设置不同的最大重试次数
   
   ## Brief changelog
   之前已经有 MAX_RECONSUME_TIMES 这个 property 了。将消息的最大重试次数的设置,也放在这个属性里。
   
   修改`DefaultMQPullConsumerImpl` , `DefaultMQPushConsumerImpl` 和 `ConsumeMessageOrderlyService`里的最大重试逻辑。
   
   逻辑都是首先从消息里取,消息里没有再取Consumer设置的,再没有取默认的16.
   ```
   private int getMaxReconsumeTimes(MessageExt messageExt) {
           if (messageExt.getMaxReConsumerTimes() >= 0) {
               return messageExt.getMaxReConsumerTimes();
           }
           if (this.defaultMQPushConsumer.getMaxReconsumeTimes() == -1) {
               return MixAll.DEFAULT_MAX_RECONSUME_TIMES;
           } else {
               return this.defaultMQPushConsumer.getMaxReconsumeTimes();
           }
       }
   ``` 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services