From the course: Complete Guide to Apache Kafka for Beginners

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Resetting offsets

Resetting offsets

Hi, this is Stephane from Conduktor and in this lecture, we're going to learn about how to reset offsets using the Kafka Consumer Groups command. So we've seen that consumers read from a consumer group and then they commit offsets once in a while, which allows them to restart the reads from where the offset was less committed. So in this example, we'll start and we'll stop a console consumer, we'll reset the offsets and then we'll start a console consumer again and see the outcome. So let's describe the consumer group we have created from before. So if we have a look at my first application, currently we see that the lag is two, two and one. So if we consume, we'll be consuming five messages. But we can also, for example, reset the offsets of this application to the very beginning to read all the messages. So the Kafka consumer groups has a thing called reset offsets. So minus minus reset offsets, and then we can set two earliest, which is the earliest the data exist in the topic. And…

Contents