Create topic

Create topic with specific partition and replication settings

kafka-topics.sh --bootstrap-server kafka:9092 --create --topic <name> --partitions 3 --replication-factor 2

tool
kafka20 commands
tags
kafka

More kafka commands

  • kafka-topics.sh --bootstrap-server kafka:9092 --describe --topic <name>

    Show partition count, replication, leaders and ISR

  • kafka-topics.sh --bootstrap-server kafka:9092 --delete --topic <name>

    Permanently delete a Kafka topic

  • kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic <name> --from-beginning

    Read all messages from a topic starting from offset 0

  • kafka-console-producer.sh --bootstrap-server kafka:9092 --topic <name>

    Send messages to a topic interactively from stdin

  • kafka-consumer-groups.sh --bootstrap-server kafka:9092 --list

    Show all consumer groups

all 20 kafka commands