Search code examples
apache-kafkaapache-kafka-connectkafka-producer-api

Is there Kafka Producer API configs to set topic auto creation?


Kafka connect has its own set of configurations to programmatically create topics, without relying upon the broker to auto-create new topics.

Is there something similar for the producer (java) API?


Solution

  • Producer? No, apart from auto-create capability - when actually producer requests a metadata of a topic that does not exist, and that caused the backend to create a topic with default configuration (if enabled). Similar with consumers (fun fact: they can be configured not to create topics even if auto-creation is enabled).

    If you want to have finer control, you'd need Kafka Admin instance.