You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@rocketmq.apache.org by "zhaoziyan (JIRA)" <ji...@apache.org> on 2017/03/01 03:04:45 UTC

[jira] [Commented] (ROCKETMQ-112) MQ client CONSUME_FROM_LAST_OFFSET dont work

    [ https://issues.apache.org/jira/browse/ROCKETMQ-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15889411#comment-15889411 ] 

zhaoziyan commented on ROCKETMQ-112:
------------------------------------

here is the auto.offset.reset of kafka . it only work on the first time a new consumer group a  topic 

auto.offset.reset	largest	
What to do when there is no initial offset in Zookeeper or if an offset is out of range:
* smallest : automatically reset the offset to the smallest offset
* largest : automatically reset the offset to the largest offset
* anything else: throw exception to the consumer. If this is set to largest, the consumer may lose some messages when the number of partitions, for the topics it subscribes to, changes on the broker. To prevent data loss during partition addition, set auto.offset.reset to smallest

> MQ client CONSUME_FROM_LAST_OFFSET dont work
> --------------------------------------------
>
>                 Key: ROCKETMQ-112
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-112
>             Project: Apache RocketMQ
>          Issue Type: Bug
>          Components: rocketmq-client
>            Reporter: zhaoziyan
>            Assignee: Xiaorui Wang
>
>         case CONSUME_FROM_LAST_OFFSET: {
>             long lastOffset = offsetStore.readOffset(mq, ReadOffsetType.READ_FROM_STORE);
>             if (lastOffset >= 0) {
>                 result = lastOffset;
>             }
>             // First start,no offset
>             else if (-1 == lastOffset) {
>                 if (mq.getTopic().startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX)) {
>                     result = 0L;
>                 }
>                 else {
>                     try {
>                         result = this.mQClientFactory.getMQAdminImpl().maxOffset(mq);
>                     }
>                     catch (MQClientException e) {
>                         result = -1;
>                     }
>                 }
>             }
>             else {
>                 result = -1;
>             }
>             break;
>         }
> offsetStore.readOffset is minOffset not the maxOffset 
> CONSUME_FROM_LAST_OFFSET dont work



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)