Compacted Topic is a feature of Apache Kafka to persist and query the latest up-to-date event of a Kafka Topic.…