Kafka: enable.auto.commit acknowledges records you have not processed yet

Auto-commit runs on a timer inside poll(), committing the offsets of everything the last poll returned - whether your loop finished handling them or not. A crash mid-batch loses every record after the last tick.

Full code & output

This topic is available to PRO members.

Sign in Create a free account

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-25