If enable.auto.commit is true and you do not use synchronous processing, what offset commit semantics do you get?

Study for the CCDAK Apache Kafka Test. Use flashcards and multiple choice questions with hints and explanations for each question. Prepare thoroughly for your exam!

Multiple Choice

If enable.auto.commit is true and you do not use synchronous processing, what offset commit semantics do you get?

Explanation:
With auto-commit enabled, the consumer advances and stores its committed offsets on a timer, independently of how you process messages. If you’re not using synchronous (manual) commits after your processing finishes, the commit can occur while you’re still working on a batch or even after an error, meaning some messages may be considered processed and their offsets committed before you’ve actually completed handling them. If a crash happens after that commit, those messages won’t be reprocessed, so you can lose data. That combination yields at-most-once semantics. Exactly-once would require coordinated transactional guarantees, and at-least-once would come from committing only after successful processing, which isn’t the case here.

With auto-commit enabled, the consumer advances and stores its committed offsets on a timer, independently of how you process messages. If you’re not using synchronous (manual) commits after your processing finishes, the commit can occur while you’re still working on a batch or even after an error, meaning some messages may be considered processed and their offsets committed before you’ve actually completed handling them. If a crash happens after that commit, those messages won’t be reprocessed, so you can lose data. That combination yields at-most-once semantics. Exactly-once would require coordinated transactional guarantees, and at-least-once would come from committing only after successful processing, which isn’t the case here.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy