Kafka medium
When a Consumer successfully executes `consumer.commitSync()`, what has functionally occurred from the cluster's perspective?
- A The data has been physically deleted from the broker's disk partition.
- B The latest offset has been safely written to the `__consumer_offsets` topic on the broker, ensuring that if the consumer restarts, it will resume from the next record.
- C The Producer has been notified to send the next batch of data immediately.
- D The message has been encrypted and moved to a 'processed' sub-topic.
Answer: B. The latest offset has been safely written to the `__consumer_offsets` topic on the broker, ensuring that if the consumer restarts, it will resume from the next record.
Committing is the 'Acknowledgement' phase. If you process a message but fail to commit the offset before crashing, Kafka will re-deliver that message to the next consumer instance, leading to 'At Least Once' delivery behavior.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When implementing 'Exactly-Once Semantics' (EOS) in a Kafka stream, what is the role of the `isolation.level=read_committed` setting on the Consumer?
- Historically, which external service was required by Kafka to manage cluster hierarchy, metadata, and leader election status?
- Once a message is successfully appended to a Kafka partition log, what is its mutability status?
- In a Kafka cluster, what is the role of a 'Broker'?
- What is the primary indicator of a bottleneck in a Kafka consumer's processing logic?
- What is the primary architectural role of Apache Kafka in a distributed system?