Re: How can I get the first valid record's offset in a partition?

2018-02-12 Thread Kamal
When you get the exception and want to read from the first valid record offset. Use, consumer#seekToBeginning(partitions) https://kafka.apache.org/0100/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#seekToBeginning(java.util.Collection) On Mon, Feb 12, 2018 at 12:09 PM, York Zhang

How can I get the first valid record's offset in a partition?

2018-02-11 Thread York Zhang
I'm trying to get the record count in a partition/topic.My solution is consuming all record in partition/topic and counting them with java api. I meet a problem that my topic is set retention.ms to 1 hour. When I consume the partition from offset whose record is already deleted, it seems that