CCDAK practice question 24 of 25
A consumer has auto.offset.reset=latest, and the topic partition currently has data for offsets going from 45 to 2311. The consumer group never committed offsets for the topic before. Where will the consumer read from?
Full set: 150 questionsThe consumer configuration auto.offset.reset=latest determines the starting point for a consumer when there is no previously committed offset for its consumer group. The value latest instructs the consumer to start reading from the end of the log. This means the consumer will skip all messages currently stored in the partition and will only begin processing new messages that are produced after the consumer has started. In this case, the last message in the partition is at offset 2311. The consumer will position itself at the end of the log to await the next message (which will be at offset 2312), effectively starting from the "latest" point.
B. offset 0: This is an arbitrary offset. The log for this partition starts at 45, so 0 is not a valid starting point.
C. offset 45: This would be the correct behavior if auto.offset.reset were set to earliest, which starts reading from the beginning of the available log.
D. it will crash: This is a standard and valid consumer configuration. The consumer is designed to handle this scenario and will not crash.
1. Confluent Documentation: In the "Consumer Configurations" section for Apache Kafka, the auto.offset.reset property is defined. The latest value specifies to "automatically reset the offset to the latest offset". This implies starting at the end of the log, processing only new messages.
Source: Confluent Documentation, Apache Kafka > Configuration > Consumer Configs, auto.offset.reset.
2. Apache Kafka Documentation: The official Kafka documentation provides the same definition, confirming this behavior is core to the Kafka consumer client.
Source: Apache Kafka Documentation, Section 3.4 "Consumer Configs", auto.offset.reset.
3. Academic/Authoritative Text: In "Kafka: The Definitive Guide," the authors explain the behavior clearly: "If auto.offset.reset is set to latest, consumers will start reading messages from the end of the partition." This means they will only see messages that are written after they start consuming.
Source: Narkhede, N., Shapira, G., & Palino, T. (2017). Kafka: The Definitive Guide. O'Reilly Media. Chapter 4, "Kafka Consumers: Reading Data from Kafka," subsection "Offsets and Consumer Position."
Keep practicing
Take the free CCDAK practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CCDAK practice questions
- Question 1In Avro, removing or adding a field that has a default is a __ schema evolution
- Question 2A topic has three replicas and you set min.insync.replicas to 2. If two out of three repl…
- Question 3To get acknowledgement of writes to only the leader partition, we need to use the config.…
- Question 4A customer has many consumer applications that process messages from a Kafka topic. Each …
- Question 5What information isn't stored inside of Zookeeper? (select two)
- Question 6If you enable an SSL endpoint in Kafka, what feature of Kafka will be lost?
