š¹ Topic Management # List all topicskafka-topics.sh --list --bootstrap-server localhost:9092 # Create a topickafka-topics.sh --create --bootstrap-server localhost:9092 \--replication-factor 1 --partitions 3 --topic my-topic # Describe a topickafka-topics.sh --describe --bootstrap-server localhost:9092 --topic my-topic # Delete a topickafka-topics.sh --delete --bootstrap-server localhost:9092 --topic my-topic š¹ Producing Messages # Start a console producerkafka-console-producer.sh --broker-list localhost:9092 --topic my-topic # With key supportkafka-console-producer.sh --broker-list localhost:9092 --topic my-topic --property "parse.key=true" --property "key.separator=:" š¹ Consuming Messages # Start a console consumerkafka-console-consumer.sh --bootstrap-server localhost:9092 --topic my-topic --from-beginning # Consume with key displaykafka-console-consumer.sh --bootstrap-server localhost:9092 \--topic my-topic --property print.key=true --property key.separator=":" --from-beginning # Consume from a specific groupkafka-console-consumer.sh --bootstrap-server localhost:9092 --topic my-topic --group my-group š¹ Consumer Groups # List consumer groupskafka-consumer-groups.sh --bootstrap-server localhost:9092 --list # Describe a consumer groupkafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group # Reset offsets (example: to earliest)kafka-consumer-groups.sh --bootstrap-server localhost:9092 \--group my-group --topic my-topic --reset-offsets --to-earliest --execute š¹ Broker Info & Cluster Metadata # Describe clusterkafka-broker-api-versions.sh --bootstrap-server localhost:9092 š¹ Utilities # Check offsets of a topic/partitionkafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic my-topic # Create a Kafka topic with zookeeper (old style)kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic my-topic