SpringSpring Kafka Advanced
What is spring.kafka.listener.ack-mode RECORD vs BATCH vs MANUAL?
Reference answer
RECORD: commit after each record (maximum overhead, minimum risk of reprocessing). BATCH: commit after processing all records in the current poll() batch (default — best balance). MANUAL: application calls Acknowledgment.acknowledge() (full control, required for transactional processing). MANUAL_IMMEDIATE: immediate synchronous commit on ack.acknowledge() call (most overhead). COUNT: commit every N records. TIME: commit every T milliseconds. For most production apps: BATCH mode + DefaultErrorHandler for error handling provides the best default. MANUAL for exactly-once or when offset commit must be tied to an external transaction.
Expected key concepts: RECORD, BATCH, MANUAL, MANUAL_IMMEDIATE, COUNT, TIME, Acknowledgment.acknowledge, poll batch, transactional, exactly-once, overhead