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/08/09 02:54:31 UTC

[GitHub] [rocketmq] solomon4github edited a comment on issue #1135: The problem of new consumer with 'CONSUME_FROM_LAST_OFFSET' model

solomon4github edited a comment on issue #1135: The problem of new consumer with  'CONSUME_FROM_LAST_OFFSET' model
URL: https://github.com/apache/rocketmq/issues/1135#issuecomment-519757956
 
 
   one guy found the reason in 2016, https://blog.csdn.net/scutshuxue/article/details/51694334#commentBox
   
   now the latest version is 4.5.1 and we could found the code in org.apache.rocketmq.broker.processor.ConsumerManageProcessor.class
   
   ```java
        if (offset >= 0) {
               responseHeader.setOffset(offset);
               response.setCode(ResponseCode.SUCCESS);
               response.setRemark(null);
           } else {
               long minOffset =
                   this.brokerController.getMessageStore().getMinOffsetInQueue(requestHeader.getTopic(),
                       requestHeader.getQueueId());
               if (minOffset <= 0
                   && !this.brokerController.getMessageStore().checkInDiskByConsumeOffset(
                   requestHeader.getTopic(), requestHeader.getQueueId(), 0)) {
                   responseHeader.setOffset(0L);
                   response.setCode(ResponseCode.SUCCESS);
                   response.setRemark(null);
               } else {
                   response.setCode(ResponseCode.QUERY_NOT_FOUND);
                   response.setRemark("Not found, V3_0_6_SNAPSHOT maybe this group consumer boot first");
               }
           }
   ```
   
   if  minOffset <= 0 ,always return 0.
   
   it make ‘ConsumeFromWhere’ not work.
   
   It's confusing to me  , and hope someone can help solve this.

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