0
0
Kafkadevops~10 mins

Topic creation in Kafka - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Kafka topic named 'my-topic'.

Kafka
bin/kafka-topics.sh --create --topic [1] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
Amy-topic
Btopic1
Ctest-topic
Dkafka-topic
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different topic name than 'my-topic'.
Omitting the --topic option.
2fill in blank
medium

Complete the code to create a Kafka topic with 3 partitions.

Kafka
bin/kafka-topics.sh --create --topic my-topic --partitions [1] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
A3
B1
C5
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting partitions to 0 or a negative number.
Forgetting to specify the --partitions option.
3fill in blank
hard

Fix the error in the command to create a topic with replication factor 2.

Kafka
bin/kafka-topics.sh --create --topic my-topic --partitions 3 --replication-factor [1] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
A0
B1
C2
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replication factor to 0.
Using a replication factor larger than the number of brokers.
4fill in blank
hard

Fill both blanks to create a topic named 'logs' with 4 partitions.

Kafka
bin/kafka-topics.sh --create --topic [1] --partitions [2] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
Alogs
Bmetrics
C4
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping topic name and partitions values.
Using wrong topic name or partition count.
5fill in blank
hard

Fill all three blanks to create a topic named 'events' with 6 partitions and replication factor 3.

Kafka
bin/kafka-topics.sh --create --topic [1] --partitions [2] --replication-factor [3] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
Aevents
B6
C3
Dlogs
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect topic name.
Mixing up partitions and replication factor values.