Apache Kafka Streaming (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are the essential Kafka CLI tools for cluster operations?
junior LevelCode ExampleCLIApache KafkaMicroservices
In Simple Words:
bash
# 1. Create a Topic with 6 partitions and 3 replicas
kafka-topics.sh --bootstrap-server localhost:9092 --create \
--topic customer-orders --partitions 6 --replication-factor 3
# 2. Describe Topic (Check Leader, Replicas, ISR list)
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic customer-orders
# 3. Inspect Consumer Group Lag (Critical for monitoring)
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe \
--group order-processing-service
# 4. Produce messages interactively
kafka-console-producer.sh --bootstrap-server localhost:9092 \
--topic customer-orders --property "parse.key=true" --property "key.separator=:"
# 5. Consume from beginning
kafka-console-consumer.sh --bootstrap-server localhost:9092 \
--topic customer-orders --from-beginning --property print.key=true