Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

PyKafka doesn't currently support creating a new topic #533

Open
jmwri opened this issue Apr 22, 2016 · 2 comments
Open

PyKafka doesn't currently support creating a new topic #533

jmwri opened this issue Apr 22, 2016 · 2 comments

Comments

@jmwri
Copy link

jmwri commented Apr 22, 2016

Is there any way that more support for creating/deleting topics can be added to PyKafka?

I am aware that calling KafkaClient.topics['a new topic name'] will create a new topic but this feels wrong.

@emmettbutler
Copy link
Contributor

Hi @jmwri, thanks for being in touch. Since the Kafka API currently doesn't support creating topics via the binary protocol, the only way that pykafka could support it is by wrapping the CLI tools with python calls. We've considered this and have decided that it's not a high priority because of the simplicity with which python allows one to shell out (subprocess.popen("kafka-topics.sh --create --zookeeper localhost:2181 --topic testtopic2 --replication-factor 1 --partitions 1".split())). If we wrapped the CLI, we'd effectively be doing just that. That said, if you feel it's useful enough, I'd support a pull request that added topic creation and deletion via the CLI to the pykafka/cli module.

@aCampello
Copy link

I understand that the issue is closed, but I still think creating a topic from the API is such an important feature for a publisher/subscriber wrapper and would massively enhance user experience, in particular if you are creating an application that is suppose to run on different environments that might not have the same kafka-topics.sh path. To note that other wrappers (such as the java client and kafka-python client) have it.

@emmettbutler emmettbutler reopened this Apr 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants