From commits-return-19861-archive-asf-public=cust-asf.ponee.io@pulsar.apache.org Wed Jan 2 18:16:34 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id AA8C918066C for ; Wed, 2 Jan 2019 18:16:33 +0100 (CET) Received: (qmail 45008 invoked by uid 500); 2 Jan 2019 17:16:32 -0000 Mailing-List: contact commits-help@pulsar.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.apache.org Delivered-To: mailing list commits@pulsar.apache.org Received: (qmail 44999 invoked by uid 99); 2 Jan 2019 17:16:32 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2019 17:16:32 +0000 From: GitBox To: commits@pulsar.apache.org Subject: [GitHub] ConcurrencyPractitioner commented on a change in pull request #3273: Adding config auto.offset.reset to PulsarKafkaConsumer Message-ID: <154644939222.13579.7771019788575340138.gitbox@gitbox.apache.org> Date: Wed, 02 Jan 2019 17:16:32 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit ConcurrencyPractitioner commented on a change in pull request #3273: Adding config auto.offset.reset to PulsarKafkaConsumer URL: https://github.com/apache/pulsar/pull/3273#discussion_r244794429 ########## File path: pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java ########## @@ -159,6 +163,16 @@ private PulsarKafkaConsumer(ConsumerConfig config, Deserializer keyDeserializ } } + private OffsetResetStrategy getStrategy(final String strategy) { + if (strategy.equals("earliest")) { + return OffsetResetStrategy.EARLIEST; + } else if (strategy.equals("latest")) { + return OffsetResetStrategy.LATEST; + } else { Review comment: Oh, actually in Kafka, OffsetResetStrategy.NONE in fact is a viable option for users. In this case, if its NONE when the offset has an invalid position, KafkaConsumer will throw an error. I forgot to replicate this behavior in the code. Will have to do that. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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