Could I create a topic in Kafka via API? Using any python library
Asked Answered
P

1

0

I'm trying to find information about the topic creation in Kafka via API, because I need to automate some tasks, It would be great if someone knows if it's possible, I was reading here:

https://docs.confluent.io/current/kafka-rest/api.html#crest-api-v3

But it didn't work for me. If I try to do

GET in /v3/clusters/ --> returns code 404
Proclaim answered 14/7, 2020 at 8:2 Comment(3)
Does this answer your question? Is it possible to create a topic with Kafka Rest Proxy?Hachman
More or less... I haven't got Kafka Rest Proxy installed and configured, so to create kafka topics from API Rest I'm using confluent-kafka library from here: docs.confluent.io/current/clients/confluent-kafka-python/…Proclaim
okay, then you might think to rephrase your question. You are not mentioning something about Python (only the tag) and put a link to the REST API. This was very misleading to me.Hachman
P
2

I'm answering my own question.

I post here what I found, that rest endpoint is useful only in case you have configured kafka rest proxy, if not, try to use any external library.

If found this one:

https://docs.confluent.io/current/clients/confluent-kafka-python/index.html

"Kafka Admin client: create, view, alter, delete topics and resources."

Proclaim answered 14/7, 2020 at 9:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.