Confluent Certified Developer for Apache Kafka (CCDAK) — Question 2

You are designing a stream pipeline to monitor the real-time location of GPS trackers, where historical location data is not required.
Each event in the stream has the following structure:
- Key: tracker_id
- Value: latitude, longitude
You need to ensure that the latest location for each tracker is always retained in the Kafka topic.

Which topic configuration parameter should you set?

Answer options

Correct answer: C

Explanation

The correct answer is C, as setting the cleanup.policy to compact allows Kafka to keep only the latest value for each key, which is essential for tracking the most recent GPS locations. Option A would remove messages immediately, B is irrelevant for this scenario, and D would retain all messages indefinitely, which is not required here.