From the course: Apache Kafka Essential Training: Getting Started

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Creating a topic

Creating a topic

- In this video, we will create two topics in Kafka. I will explore the topic, "Creation Command" first. It is available in the Chapter Three commands.text file. The script to use for creating topics is the Kafka topics.sh script. What are the parameters for the script? First, we need to provide a link to the Kafka broker. This is provided with the parameter bootstrap-server. Note that we are using the internal port 29.0.9.2 as we are accessing the broker from inside the docker cluster. Then comes the action, which in this case is create. We provide the name of the topic in the topic parameter. While this name can be any string, it is recommended to use a pattern of qualified names for better management. In this case, it is a tweets topic called Kafka.learning.tweets. We then specify two mandatory parameters, the number of partitions and the replication factor. We keep the partition size to one. We will discuss partitions…

Contents