Which statement is true about how exactly-once semantics (EOS) work in Kafka Streams?
A.
Kafka Streams disables log compaction on internal changelog topics to preserve all state changes for potential recovery.
B.
EOS in Kafka Streams relies on transactional producers to atomically commit state updates to changelog topics and output records to Kafka.
C.
Kafka Streams provides EOS by periodically checkpointing state stores and replaying changelogs to recover only unprocessed messages during failure.
D.
EOS in Kafka Streams is implemented by creating a separate Kafka topic for deduplication of all messages processed by the application.
The Answer Is:
B
This question includes an explanation.
Explanation:
Kafka Streams uses transactional producers to guarantee exactly-once semantics (EOS). This ensures that both the output records and state store updates are committed atomically, avoiding duplication or partial writes.
From Kafka Streams Documentation > Processing Guarantees:
“Kafka Streams leverages Kafka’s transactional APIs to commit the output records and internal state updates as a single atomic unit, thereby providing exactly-once semantics.”
Option A is incorrect because log compaction is not disabled for EOS.
Option C incorrectly describes a checkpointing system Kafka Streams does not use.
Option D refers to deduplication, which is not how EOS is achieved in Streams.