Challenge - 5 Problems
Kafka Topic Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of the topic configuration command?
You run the following Kafka command to create a topic with 3 partitions and a replication factor of 2. What will be the output message?
Kafka
kafka-topics.sh --create --topic my-topic --partitions 3 --replication-factor 2 --bootstrap-server localhost:9092
Attempts:
2 left
💡 Hint
Check if the cluster has at least 2 brokers to support replication factor 2.
✗ Incorrect
If the cluster has enough brokers, the topic is created successfully with the specified partitions and replication factor.
🧠 Conceptual
intermediate1:30remaining
What does the 'cleanup.policy' configuration control?
In Kafka topic configuration, what is the purpose of the 'cleanup.policy' setting?
Attempts:
2 left
💡 Hint
Think about how Kafka manages old data in topics.
✗ Incorrect
The 'cleanup.policy' can be 'delete' to remove old data or 'compact' to keep the latest record per key.
❓ Predict Output
advanced2:00remaining
What is the effect of setting 'min.insync.replicas' to 2?
Given a topic with replication factor 3, what happens if 'min.insync.replicas' is set to 2 and only 1 replica is in sync during a produce request?
Attempts:
2 left
💡 Hint
Consider what 'min.insync.replicas' means for message durability.
✗ Incorrect
If the number of in-sync replicas is less than 'min.insync.replicas', Kafka rejects produce requests to ensure durability.
❓ Predict Output
advanced1:30remaining
What is the output of describing a topic with a retention.ms of 604800000?
You run the command to describe a topic and see the retention.ms configuration set to 604800000. What does this value represent?
Kafka
kafka-configs.sh --describe --entity-type topics --entity-name my-topic --bootstrap-server localhost:9092Attempts:
2 left
💡 Hint
Convert milliseconds to days to understand retention time.
✗ Incorrect
604800000 milliseconds equals 7 days, so messages are kept for 7 days before being deleted.
🧠 Conceptual
expert2:30remaining
Which configuration ensures message order within a partition?
Which Kafka topic configuration guarantees that messages are consumed in the order they were produced within a partition?
Attempts:
2 left
💡 Hint
Think about how Kafka handles message sending and retries.
✗ Incorrect
'max.in.flight.requests.per.connection' set to 1 ensures messages are sent one at a time, preserving order.