You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/01/02 08:54:34 UTC

[GitHub] sijie commented on a change in pull request #3273: Adding config auto.offset.reset to PulsarKafkaConsumer

sijie commented on a change in pull request #3273: Adding config auto.offset.reset to PulsarKafkaConsumer
URL: https://github.com/apache/pulsar/pull/3273#discussion_r244682938
 
 

 ##########
 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<K> 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:
   I would prefer failing-fast if strategy is not null or empty here and logging a message to tell users that this is a wrong setting.

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