intermediateBuilding the Consumer Microservice

Why is manual offset commit (rather than auto-commit) often preferred for a consumer doing meaningful processing?

Auto-commit advances the offset on a timer regardless of whether your processing actually succeeded, so a crash mid-processing can mean that message is never retried (it's already marked as consumed). Manual commit lets you commit the offset only AFTER your processing logic completes successfully, so a failure leaves the offset uncommitted and the message gets redelivered on restart.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Why does a Kafka consumer that writes to a database need to think about idempotency, not just 'save the record'?← Back to all Kafka & Microservices questions