How to seek to beginning of all partitions of a topic without issuing a poll first?

2017-12-14 Thread Behrang Saeedzadeh
Hi In my consumer app, in order to start consuming records from the beginning of all partitions of a given Kafka topic, I first have to issue a poll to make sure partitions are assigned to my consumer: consumer.poll(1000); consumer.seekToBeginning(consumer.assignment()); Is there an alternative

Re: How to seek to beginning of all partitions of a topic without issuing a poll first?

2017-12-14 Thread Behrang Saeedzadeh
I found a better approach: final List partitions = consumer.partitionsFor(TOPIC_NAME) .stream() .map(part -> new TopicPartition(TOPIC_NAME, part.partition()))