Complete the code to set a time-based retention policy of 7 days for a Kafka topic.
retention.ms=[1] # Set retention to 7 days in milliseconds
The retention.ms property is set in milliseconds. 7 days = 7 * 24 * 60 * 60 * 1000 = 604800000 ms.
Complete the code to set a size-based retention policy of 1 GB for a Kafka topic.
retention.bytes=[1] # Set retention size to 1 GB
1 GB in bytes is 1024 * 1024 * 1024 = 1073741824 bytes.
Fix the error in the retention policy configuration to correctly set retention to 3 days.
retention.ms = [1] # Intended 3 days retention
3 days in milliseconds is 3 * 24 * 60 * 60 * 1000 = 259200000 ms.
Fill both blanks to create a retention policy that deletes messages older than 2 days or when the log size exceeds 500 MB.
retention.ms = [1] retention.bytes = [2]
2 days in milliseconds is 2 * 24 * 60 * 60 * 1000 = 172800000 ms.
500 MB in bytes is 500 * 1024 * 1024 = 524288000 bytes.
Fill all three blanks to configure a Kafka topic with a retention time of 12 hours, a retention size of 200 MB, and a cleanup policy of delete.
retention.ms = [1] retention.bytes = [2] cleanup.policy = "[3]"
12 hours in milliseconds is 12 * 60 * 60 * 1000 = 43200000 ms.
200 MB in bytes is 200 * 1024 * 1024 = 209715200 bytes.
The cleanup policy 'delete' means old messages are removed based on retention policies.