API to create a topic with a particular number of partitions
Is it possible to use this client library to create a topic with a particular number of partitions, like the kafka-create-topic.sh script which ships with kafka allows? I couldn't spot any API for this (or even to create a topic at all!)
It can be useful to do this programmatically, e.g. when setting up system/integration tests.
Topics are automatically lazily by Kafka. If you start producing to it, it will be created with some defaults defined by the broker. I believe those scripts in the Kafka dist talk to ZK directly to update topic/partition metadata. We only talk to Kafka through the published APIs, so we can't do that. It might be worth asking about this on the kafka-user list to see if there is a way to create a topic with N partitions through the API
I don't see any API for creating topics (https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol) . You might pop onto the kafka mailing lists (http://kafka.apache.org/contact.html) and see if there are any plans to add this to the server API.
Interesting. OK cheers for the pointers!
On Fri, Aug 22, 2014 at 6:05 PM, Dana Powers [email protected] wrote:
I don't see any API for creating topics ( https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol) . You might pop onto the kafka mailing lists ( http://kafka.apache.org/contact.html) and see if there are any plans to add this to the server API.
— Reply to this email directly or view it on GitHub https://github.com/mumrah/kafka-python/issues/202#issuecomment-53090066.
Is this possible now? Is there a way to create a topic with n partitions using the API?