In my flink streaming application I have kafka datasource. I am using the
kafka property auto.offset.reset=latest. I am wondering if I need to use
FlinkKafkaConsumer.setStartFromLatest(). Are they similar? Can I use either
of them? Following is the documentation from flink code.
/**
 * Specifies the consumer to start reading from the latest offset for all
partitions. This lets
 * the consumer ignore any committed group offsets in Zookeeper / Kafka
brokers.
 *
 * <p>This method does not affect where partitions are read from when the
consumer is restored
 * from a checkpoint or savepoint. When the consumer is restored from a
checkpoint or savepoint,
 * only the offsets in the restored state will be used.
 *
 * @return The consumer object, to allow function chaining.
 */
public FlinkKafkaConsumerBase<T> setStartFromLatest() {
    this.startupMode = StartupMode.LATEST;
    this.startupOffsetsTimestamp = null;
    this.specificStartupOffsets = null;
    return this;
}

Thanks

Reply via email to