Vinod Jayachandran
Vinod Jayachandran

Reputation: 3898

Programatically (JAVA) Create/Delete partition from Kafka Topic

On demand runtime, can I programatically (using java) Create/Delete partition from Kafka Topic

I am using Java Apache Kafka Client (0.10) and Apache Kafka installation (0.10)

Upvotes: 0

Views: 867

Answers (1)

amethystic
amethystic

Reputation: 7089

Invoke AdminUtils.createTopic and AdminUtils.deleteTopic to create and delete topics respectively.

EDIT:

Use AdminUtils.addPartitions to add partitions for a topic. Kafka currently does not support to decrease the partition number.

Upvotes: 1

Related Questions