Kafka topics can be created either automatically or manually. It is best practice to manually create all input/output topics before starting an application, rather than using auto topic. However, topics do not need to be manually created.
Creating topics automatically is the default setting. You can confirm if this is the case for your implementation by checking that the property auto.create.topics.enable is set to true. With this setting, topics are automatically created when applications produce, consume, or fetch metadata from a not yet existent topic.
For auto topic creation, it’s good practice to check num.partitions for the default number of partitions and default.replication.factor for the default number of replicas of the created topic.
To create topics manually, run kafka-topics.sh and insert topic name, replication factor, and any other relevant attributes. For example:
> bin/kafka-topics.sh –create
–bootstrap-server localhost:9092
–replication-factor 10
–partitions 3
–topic test