jerrypeng closed pull request #1896: When fetching from kafka, specify to get
the earliest of messages
URL: https://github.com/apache/incubator-pulsar/pull/1896
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaSource.java
b/pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaSource.java
index fa734184b1..ad967be2cb 100644
--- a/pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaSource.java
+++ b/pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaSource.java
@@ -69,6 +69,7 @@ public void open(Map<String, Object> config) throws Exception
{
props.put(ConsumerConfig.FETCH_MIN_BYTES_CONFIG,
kafkaSourceConfig.getFetchMinBytes().toString());
props.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG,
kafkaSourceConfig.getAutoCommitIntervalMs().toString());
props.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG,
kafkaSourceConfig.getSessionTimeoutMs().toString());
+ props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,
kafkaSourceConfig.getKeyDeserializationClass());
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,
kafkaSourceConfig.getValueDeserializationClass());
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services