0
votes

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)

1
a) what have you tried yourself so far? b) it wouldn't hurt you to write your questions with some question marks, would it? - Franz Gleichmann
I agree. Would definitely follow it from next time. - Vinod Jayachandran
you can edit your question - Franz Gleichmann

1 Answers

1
votes

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.