Creating and Deleting the Topics

How to Create and Delete Topic in Kafka using Ubuntu?

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.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store