Manage Apache Kafka® topics

Create a topic

1. Go to the console.

2. Choose Clusters from the list of services on the left.

3. Select the cluster whose topics you want to manage.

4. On the cluster page, go to the Topics tab.

5. Click Create.

6. Under Topic Settings, specify the connection properties:

• Cleanup policy

Specifies what to do with old log messages. It can have one of the following values:

• Delete: Deletes log segments when their retention time or log size reaches the limit.

• Compact: Compresses messages in the log. The service keeps only one log file for each primary log key in this case.

• Compact and delete: Both compacts and deletes log segments.

Warning

Note that topics of the Compact and Compact and delete types require that you specify keys for your messages.

• Compression Type

Specifies the codec used for message compression:

• Uncompressed: Compression is disabled

• Zstd: The zstd codec

• Lz4: The lz4 codec

• Snappy: The snappy codec

• Gzip: The gzip codec

• Producer: The codec is set on the producer side

• Retention Bytes

The maximum size of a partition in bytes. When the partition reaches this size, Apache Kafka® deletes the old log segments. The setting applies if the cleanup policy is Delete.

• Retention Ms

Time in milliseconds for Apache Kafka® to keep log segment files. This setting applies if the cleanup policy is Delete. After the specified time, the segment file is deleted.

7. Specify the Basic Settings:

• Name

A topic name. It must be unique in the Apache Kafka® cluster.

• Partitions

A number of topic partitions .

• Replication factor

Specifies the number of copies of a topic in a cluster. This parameter value should not exceed the number of brokers in the cluster.

8. Click Submit.

Manage a topic

1. Go to the console.

2. Choose Clusters from the list of services on the left.

3. Select the cluster whose topics you want to manage.

4. On the cluster's page, go to the Topics tab.

5. Click and select Edit.

6. On the edit page, you can change all settings listed in the Create a topic section.

7. Click Submit.

Delete a topic

1. Go to the console.

2. Choose Clusters from the list of services on the left.

3. Select the cluster whose topics you want to manage.

4. On the cluster's page, go to the Topics tab.

5. Click and select Delete.