Creating Topic ZooKeeper/Kafka Server: Apache ZooKeeper is a software project of the Apache Software Foundation. It is essentially a service for distributed systems offering a hierarchical key-value store, which is used to provide a distributed configuration service, synchronization service, and naming registry for large distributed systems.

The topic will be created in ZooKeeper.

Data is inserted into partitions created in topic with Kafka server, we can create any number of Topics and we can any number of partitions in a topic

How to Create a Topic in ZooKeeper?

Create the maven project with below dependency

Create the class with name TopicCreation.java

Generally, ZooKeeper runs on 2181 Port if your ZooKeeper runs on different port change accordingly.

We can give multiple ZooKeeper Hosts with respective port no.

Run the class as Java application to create Topic in

Also Read: Kafka Consumer Examples Using Java

Creating Topic Zookeeper/Kafka Server

Leave a Reply

Your email address will not be published. Required fields are marked *