Creating and Deleting the Topics

How to Create and Delete Topic in Kafka using Ubuntu?

Learn how to create and delete the topics.

Please make sure that Zookeeper and Kafka server are running.

Getting Started

I) Creating Topics --zookeeper --topic first_topic --create --partitions 3 --replication-factor 1

Check the list of topics created. --zookeeper --list

Get more information on a specific Topic --zookeeper --topic first_topic --describe

Creating a second Topic --zookeeper --topic second_topic --create --partitions 6 --replication-factor 1

Deleting the topic

  1. List all topics --zookeeper --list

2. Delete the topic --zookeeper --topic second_topic --delete

→ by default the delete.topic.enable is set true.

3. Verify the deletion — zookeeper --list

Summary: You have learned to Create and Delete the Topic.

Software Engineer at HCL | Technical Content Writing | Follow me on LinkedIn