Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change the replication factor of an existing kafka topic using java?

I am using AdminClient to alter other configurations of existing kafka topic. But I cannot find a method to change the replication factor of the topic. Is there any way that I can change the replication factor using java?

like image 345
Naman Kumar Avatar asked Oct 26 '25 18:10

Naman Kumar


1 Answers

This is currently not possible using the AdminClient. However there is a KIP in progress, KIP-455, that will add that functionality soon.

At the moment, the recommended way to change the replication factor of a topic is to use the kafka-reassign-partitions.sh tool, see this section in the docs.

like image 89
Mickael Maison Avatar answered Oct 28 '25 09:10

Mickael Maison