How to Add Partitions to an Existing Topic in Kafka

Yatin batraYatin batra
1 min read

Date: 2025-03-14

This article explains how to add partitions to a Kafka topic to improve performance and scalability. Kafka topics are divided into partitions for parallel processing and fault tolerance. The article details using the Kafka CLI command kafka-topics.sh to increase the number of partitions for an existing topic, and also shows how to do this programmatically using the Java AdminClient API. Increasing partitions requires careful consideration of message ordering and consumer rebalancing. Note that you can only increase, not decrease, the number of partitions using this method.

Read more: https://www.javacodegeeks.com/kafka-add-partitions-in-topic-example.html

0
Subscribe to my newsletter

Read articles from Yatin batra directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Yatin batra
Yatin batra