Horje
How to get all Topics in Apache Kafka?

Apache Kafka is an open-source event streaming platform that is used to build real-time data pipelines and also to build streaming applications. Kafka is specially designed to handle a large amount of data in a scalable way.

In this article, we will learn how to get all topics in Apache Kafka.

Steps to get the list of all topics in Apache Kafka

Below are the steps and commands to get the list of all topics in Apache Kafka.

Step 1: Start the Zookeeper Server

To list all the topics in Kafka, first, we need to start the zookeeper server in the Apache Kafka folder location.

Here is the command to start the zookeeper server.

.\bin\windows\zookeeper-server-start.bat config\zookeeper.properties

Run the above command in the command prompt so that we can start the zookeeper as shown below:

ZooKeeper Started

Step 2: Start the Kafka Server

To start the Kafka Server, here is the command:

.\bin\windows\kafka-server-start.bat config\server.properties

The above command is used to start the Kafka server and here is the attachment of after starting the Kafka Server:

Kafka Server Started

Step 3: Get the Topics in ApacheKafka

To get all the topics in Apache Kafka, we need to use the below command:

.\bin\windows\kafka-topics.bat --list --bootstrap-server localhost:9092

Here is the attachment to see the list of topics in Apache Kafka:

List of topics

The above command is used to get all the topics available in Apacke Kafka.




Reffered: https://www.geeksforgeeks.org


Advance Java

Related
Configure Multiple DataSources in Spring Boot Configure Multiple DataSources in Spring Boot
Spring Security - Find the Registered Filters Spring Security - Find the Registered Filters
Spring Boot - Multiple Databases Connection For MongoDB using One Application Spring Boot - Multiple Databases Connection For MongoDB using One Application
Spring Security - Role Based Authentication Spring Security - Role Based Authentication
Spring - WebClient vs RestTemplate Spring - WebClient vs RestTemplate

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
13