Skip to content
Exercise · Kafka consumers · lesson 4 of 9

Exercise: the poll loop

A Kafka consumer reads a partition in batches: each call to poll returns several records. After processing a batch, the consumer commits an offset, and after a restart reading continues from it. Commit too early and a crash loses records; commit too late and they are read again.