0
votes

I'm using spring-kafka-2.2.7-RELEASE. I'm using @KafkaListener to create my consumer.

I've set enable.auto.commit to true and auto.commit.interval.ms to 10,000 (i.e., 10 sec). Now my question is - does the consumer the commit offset for each record or does it commit and advance the offset by the no of records it consumed during the 10 sec ?

1

1 Answers

2
votes

We generally recommend not using auto.commit.enabled=true; letting the container do the commits with BATCH or RECORD AckModes is more deterministic (before the next poll() or after each record is processed, respectively).

With version 2.3, we disable auto commit by default (unless it is explicitly set in the config).

With auto commit, my understanding is the commits will happen during a poll() if the interval has elapsed since a previous poll. It will commit the latest offset for each partition that have been previously processed since the last commit.