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 2022/10/11 09:10:40 UTC

[GitHub] [rocketmq-flink] zhouxinyu commented on a diff in pull request #46: [#35] Use `LitePullConsumer` model instead of default pull consumer

zhouxinyu commented on code in PR #46:
URL: https://github.com/apache/rocketmq-flink/pull/46#discussion_r992057758


##########
src/main/java/org/apache/rocketmq/flink/source/enumerator/RocketMQSourceEnumerator.java:
##########
@@ -337,16 +339,16 @@ private long getOffsetByMessageQueue(MessageQueue mq) throws MQClientException {
             } else {
                 switch (consumerOffsetMode) {
                     case CONSUMER_OFFSET_EARLIEST:
-                        offset = consumer.minOffset(mq);
-                        break;
+                        consumer.seekToBegin(mq);
+                        return -1;
                     case CONSUMER_OFFSET_LATEST:
-                        offset = consumer.maxOffset(mq);
-                        break;
+                        consumer.seekToEnd(mq);
+                        return -1;

Review Comment:
   Return directly with -1, this is a different behavior compared to the old version or `CONSUMER_OFFSET_TIMESTAMP`.
   
   It's recommended to unify the behavior.



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