@Override public void seekFetcherToInitialOffsets( List<KafkaTopicPartitionLeader> partitions, Fetcher fetcher) throws Exception { for (KafkaTopicPartitionLeader tp : partitions) { long offset = getOffsetFromZooKeeper( curatorClient, groupId, tp.getTopicPartition().getTopic(), tp.getTopicPartition().getPartition()); if (offset != OFFSET_NOT_SET) { LOG.info( "Offset for partition {} was set to {} in ZooKeeper. Seeking fetcher to that position.", tp.getTopicPartition().getPartition(), offset); // the offset in Zookeeper was the last read offset, seek is accepting the // next-to-read-offset. fetcher.seek(tp.getTopicPartition(), offset + 1); } } }