0
0
Kafkadevops~10 mins

Why topics organize messages in Kafka - Test Your Understanding

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 'orders'.

Kafka
bin/kafka-topics.sh --create --topic [1] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
Aevents
Bmessages
Corders
Dlogs
Attempts:
3 left
💡 Hint
Common Mistakes
Using a generic name like 'messages' instead of a specific topic name.
Leaving the topic name blank.
2fill in blank
medium

Complete the code to produce a message to the 'orders' topic.

Kafka
echo 'order_id=123' | bin/kafka-console-producer.sh --topic [1] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
Aorders
Blogs
Cmessages
Devents
Attempts:
3 left
💡 Hint
Common Mistakes
Sending messages to the wrong topic name.
Typos in the topic name.
3fill in blank
hard

Fix the error in the command to consume messages from the 'orders' topic.

Kafka
bin/kafka-console-consumer.sh --topic [1] --bootstrap-server localhost:9092 --from-beginning
Drag options to blanks, or click blank then click option'
Aorders
Bmessages
Clogs
Devents
Attempts:
3 left
💡 Hint
Common Mistakes
Using a topic name that does not exist.
Misspelling the topic name.
4fill in blank
hard

Fill both blanks to create a topic with 3 partitions and a replication factor of 2.

Kafka
bin/kafka-topics.sh --create --topic orders --partitions [1] --replication-factor [2] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
A3
B1
C2
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replication factor higher than the number of brokers.
Using zero or negative numbers.
5fill in blank
hard

Fill all three blanks to produce a message with key 'user1' and value 'login' to the 'user-events' topic.

Kafka
echo '[1]:[2]' | bin/kafka-console-producer.sh --topic [3] --property parse.key=true --property key.separator=: --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
Auser1
Blogin
Cuser-events
Dlogout
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up key and value positions.
Using the wrong topic name.