Commands Cheat Sheet

Evaluating engineering tools? Get the comparison in Google Sheets

(Perfect for making buy/build decisions or internal reviews.)

Most-used commands
Your email is safe thing.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

Connect

kafka-console-consumer.sh --bootstrap-server : --topic
Connect to consume messages from a topic

kafka-console-producer.sh --broker-list : --topic
Connect to produce messages to a topic

Topics

kafka-topics.sh --bootstrap-server : --list
List all topics

kafka-topics.sh --bootstrap-server : --create --topic --partitions --replication-factor
Create a new topic

kafka-topics.sh --bootstrap-server : --describe --topic
Show topic details

kafka-topics.sh --bootstrap-server : --delete --topic
Delete a topic

Consumers

kafka-consumer-groups.sh --bootstrap-server : --list
List all consumer groups

kafka-consumer-groups.sh --bootstrap-server : --describe --group
Describe consumer group

kafka-consumer-groups.sh --bootstrap-server : --reset-offsets --to-earliest --execute --group --topic
Reset consumer group offsets

Messages

kafka-console-consumer.sh --bootstrap-server : --topic --from-beginning
Consume all messages from beginning

kafka-console-consumer.sh --bootstrap-server : --topic --max-messages
Consume limited number of messages

kafka-console-consumer.sh --bootstrap-server : --topic --property print.key=true --property print.timestamp=true
Consume messages with keys and timestamps

Configurations

kafka-configs.sh --bootstrap-server : --entity-type topics --entity-name --describe
Describe topic configuration

kafka-configs.sh --bootstrap-server : --entity-type topics --entity-name --alter --add-config =
Update topic configuration

kafka-configs.sh --bootstrap-server : --entity-type brokers --entity-name --describe
Describe broker configuration

Monitoring

kafka-topics.sh --bootstrap-server : --describe --topic __consumer_offsets
Inspect consumer offsets topic

kafka-consumer-groups.sh --bootstrap-server : --all-groups --describe --state
Show state of all consumer groups

kafka-run-class.sh kafka.admin.ConsumerGroupCommand --bootstrap-server : --describe --group
Detailed consumer group information