0
0
Kafkadevops~10 mins

Kafka CLI tools overview - Interactive Code Practice

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

Complete the command to list all Kafka topics.

Kafka
kafka-topics.sh --bootstrap-server localhost:9092 --[1]
Drag options to blanks, or click blank then click option'
Acreate
Bdescribe
Cdelete
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'list' will try to create a topic.
Using 'delete' will remove topics, which is not intended here.
2fill in blank
medium

Complete the command to create a topic named 'my-topic' with 3 partitions.

Kafka
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic my-topic --partitions [1]
Drag options to blanks, or click blank then click option'
A3
B1
C5
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 partitions is invalid and causes an error.
Using 1 partition creates only a single partition, not 3.
3fill in blank
hard

Fix the error in the command to describe a topic named 'orders'.

Kafka
kafka-topics.sh --bootstrap-server localhost:9092 --[1] orders
Drag options to blanks, or click blank then click option'
Adescribe
Bcreate
Clist
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' will show all topics, not details of one.
Using 'create' or 'delete' will change topics, not describe.
4fill in blank
hard

Fill both blanks to consume messages from 'my-topic' starting from the beginning.

Kafka
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic my-topic --[1] --[2]
Drag options to blanks, or click blank then click option'
Afrom-beginning
Bgroup
Coffset
Dpartition
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'offset' or 'partition' options here is incorrect for this purpose.
Omitting the consumer group can cause unexpected behavior.
5fill in blank
hard

Fill all three blanks to produce a message 'Hello' to 'my-topic' using the console producer.

Kafka
echo "Hello" | kafka-console-producer.sh --bootstrap-server localhost:9092 --topic [1] --[2] [3]
Drag options to blanks, or click blank then click option'
Amy-topic
Bproperty
Cacks
Dretries
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'acks' with 'retries' changes message delivery guarantees.
Omitting '--property' causes the producer to use defaults.