Complete the code to create a Kafka topic named 'orders'.
bin/kafka-topics.sh --create --topic [1] --bootstrap-server localhost:9092
The topic name 'orders' is used to organize messages related to orders in Kafka.
Complete the code to produce a message to the 'orders' topic.
echo 'order_id=123' | bin/kafka-console-producer.sh --topic [1] --bootstrap-server localhost:9092
The message is sent to the 'orders' topic to keep order-related messages organized.
Fix the error in the command to consume messages from the 'orders' topic.
bin/kafka-console-consumer.sh --topic [1] --bootstrap-server localhost:9092 --from-beginning
Consuming from the correct topic 'orders' ensures you get the right messages.
Fill both blanks to create a topic with 3 partitions and a replication factor of 2.
bin/kafka-topics.sh --create --topic orders --partitions [1] --replication-factor [2] --bootstrap-server localhost:9092
Partitions divide the topic for parallelism; replication factor ensures fault tolerance.
Fill all three blanks to produce a message with key 'user1' and value 'login' to the 'user-events' topic.
echo '[1]:[2]' | bin/kafka-console-producer.sh --topic [3] --property parse.key=true --property key.separator=: --bootstrap-server localhost:9092
The key 'user1' and value 'login' are sent to the 'user-events' topic to organize user activity messages.