Kafka 0.9 - How to create a theme through java api

New to Kafka.

It is not easy to figure out how to use java-api to create a theme in release 0.9.

This answer applies to 0.8.

I see that Cluster has methods for requesting section information, topics, etc. But I do not see how I can dynamically create a theme.

+8
java apache-kafka
source share
1 answer

For Kafka, the cluster defines how / if you can create themes. If you want to be able to create themes on the fly, the easiest way to use auto.create.topics.enable in your cluster. Then, when you post to a topic that does not exist, the cluster creates a topic with the default sections of the cluster and replication rate. If you do not have / this feature enabled, there are no methods in the Kafka client library that I know of.

If you decide, you can look into the insides of kafka-topics.sh , in which you will find Kafka creates themes with the main api.

+11
source share

All Articles