I'm using confluent-kafka
KafkaConsumer library for reading data from kafka. Here is the scenario.
Demo
topic is compaction enabled.- Consumer-1 is reading data using the latest property with a group.id="group-1".
- Now I want Consumer-2 to read all data from the beginning in topic with group.id="group-2".
- When I use
auto.offset.reset="earliest"
it reads data from the beginning, but in case the consumer restarts then it again reads data from the beginning.
How should I configure new consumer-2 so that it will read data from the beginning only once, after this, it will give only the not acknowledged data.
Thanks