Creating an Apache Kafka® topic#
While you can set Apache Kafka® to automatically create a topic when the a message is produced to a topic that does not exist, creating topics beforehand is generally considered a preferred practice and recommended for production environments:
it lets you to define granular topic settings such as the number of partitions, the replication factor, the retention period and more.
It prevents the wrong topic being generated (for instance with typos).
Create an Apache Kafka® topic via Aiven Console#
To create a new topic via the Aiven Console:
On the Services page, click on the Aiven for Apache Kafka® service where you want to crate the topic.
Select the Topics tab:
In the Add new topic section, enter a name for your topic.
In the Advanced configuration you can set the replication factor, number of partitions and other advanced settings. These can be modified later.
Click Add Topic on the right hand side of the console.
The new topic will be visible immediately, but may take a few minutes before you can update its settings.
You can also use the dedicated topic-create function to create a new topic via the Aiven CLI.