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.

Consumer offsets commit strategies

Consumer offsets commit strategies - Kafka Tutorial

From the course: Complete Guide to Apache Kafka for Beginners

Consumer offsets commit strategies

Hi, this is Stephane from Conduktor and we're going to have a look at the consumer offset commit strategies available to you. So there are two common patterns for committing offsets in your application. The first one is the easy one that we've been using so far, which is that enable auto commit is true, and then we get a synchronous processing of batches. And this is what we've been doing in our code. And the second one is to disable, enable auto commit and to manually commit offsets. There may be some advantages there, but you need to be aware of the trade offs you're making. So let's dive in. So first, let's do a deep dive into the auto offset commit behavior. So when you use the Java Consumer API behind the scenes, the offsets are going to be regularly committed as you've seen before. And this enables at least once reading scenarios by default under certain conditions. So these offsets are going to be committed whenever the poll function is going to be called in your code. And then…

Contents