Understanding Apache Kafka: Exactly Once Semantics
A beginner's quiz on the basics of exactly once semantics in Apache Kafka.
Questions in this quiz
15 questions on Understanding Apache Kafka: Exactly Once Semantics. Work through them here, then start the quiz to answer them and see your score.
1.What does 'exactly once semantics' in Apache Kafka ensure?
- AMessages are delivered exactly once to the consumer.
- BMessages are delivered at most once.
- CMessages are delivered at least once.
- DMessages are delivered twice to ensure reliability.
2.Which Kafka feature is primarily used to achieve exactly once semantics?
- AIdempotent Producer
- BKafka Streams
- CLog Compaction
- DConsumer Groups
3.Which configuration must be enabled on the producer to support exactly once semantics?
- Aacks=0
- Backs=all
- Cacks=1
- Dacks=none
4.What role does Kafka's transaction API play in exactly once semantics?
- AIt compresses messages for efficient storage.
- BIt ensures messages are delivered in order.
- CIt allows atomic writes across multiple partitions.
- DIt allows for batch processing.
5.What is the default isolation level for consumers in Kafka to support exactly once semantics?
- Aread_repeatable
- Bread_uncommitted
- Cread_committed
- Dread_serializable
6.How does Kafka ensure idempotency in message production?
- ABy using consumer offsets.
- BBy compressing messages.
- CBy storing messages in memory.
- DBy using unique producer IDs and sequence numbers.
7.Which of the following is NOT a requirement for enabling exactly once semantics in Kafka?
- ALog compaction
- BTransactional producer
- CIdempotent producer
- DConsumer group offsets
8.What happens if a producer fails after sending a message but before committing the transaction?
- AThe message is duplicated.
- BThe message is rolled back.
- CThe message is immediately delivered.
- DThe message is lost.
9.What is the purpose of the 'transactional.id' configuration in Kafka?
- ATo uniquely identify a transactional producer.
- BTo set the replication factor.
- CTo identify the consumer group.
- DTo enable message compression.
10.Which Kafka component is responsible for maintaining the state of transactions?
- AProducer
- BConsumer
- CTransaction Coordinator
- DBroker
11.What is the main advantage of using exactly once semantics in Kafka?
- AIncreased throughput
- BSimplified configuration
- CReduced latency
- DData consistency and reliability
12.Which of the following is a common challenge when implementing exactly once semantics?
- AIncreased complexity
- BHigh network latency
- CIncreased message size
- DReduced data retention
13.What does the 'enable.idempotence' configuration do in Kafka?
- APrevents duplicate message production
- BIncreases message retention time
- CEnables message compression
- DEnsures messages are delivered in order
14.How does Kafka handle duplicate messages in exactly once semantics?
- ABy ignoring duplicates during consumption
- BBy storing them in a separate topic
- CBy compressing them
- DBy using sequence numbers to detect duplicates
15.What is the effect of enabling exactly once semantics on Kafka's performance?
- AIt has no effect on performance.
- BIt increases throughput.
- CIt may slightly reduce throughput due to additional processing.
- DIt reduces latency.