CCDAK · Question #157
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…
The correct answer is C. cleanup.policy = compact. Setting cleanup.policy = compact enables log compaction, ensuring that only the latest value for each key (tracker_id) is retained in the topic, which is ideal for storing the most recent GPS location per tracker.
Question
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?
Options
- Aretention.ms = 0
- Bmin.cleanable.dirty.ratio = -1
- Ccleanup.policy = compact
- Dretention.ms = infinite
How the community answered
(57 responses)- A14% (8)
- B7% (4)
- C75% (43)
- D4% (2)
Explanation
Setting cleanup.policy = compact enables log compaction, ensuring that only the latest value for each key (tracker_id) is retained in the topic, which is ideal for storing the most recent GPS location per tracker.
Topics
Community Discussion
No community discussion yet for this question.