Big Data - Apache Kafka

Back to Course

Lesson Description

Lession - #454 Kafka Basic Operations

Basic operations

Modifying a Topic

The command for modifying the created topic is:


bin/kafka-topics.sh —zookeeper localhost:2181 --alter --topic topic_name 
--parti-tions count


We have already made a topic Hello-Kafka” with single partition count and one replica factor.

Presently utilizing "adjust" order we have changed the parcel count.

bin/kafka-topics.sh --zookeeper localhost:2181
--alter --topic Hello-kafka --parti-tions 2 ​

Output WARNING: If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected Adding partitions succeeded! ​

Deleting a Topic

To delete a topic, the syntax is:

bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic topic_name

Example bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic Hello-kafka ​


> Topic Hello-kafka marked for deletion ​

Note− This will have no impact if delete.topic.enable is not set to true

What is Kafka exporter?
This job is the JMX exporter that runs on the kafka brokers as a javaagent.

Where is Kafka default port?
By default, the Kafka server is started on port 9092 .

Is Kafka available in GCP?
We have used the open source version of Kafka available in the Marketplace of GCP

Is Kafka a monitoring tool?
Kafka in Cloudera Manager is clearly a less rich monitoring tool compared to Confluent, Lenses and Datadog.

Kafka topic list and Kafka Elasticsearch connector? -

Authentication overview and java Example for Apache Kafka and Producer Configurations and Confluent Documentation