Scenario
In the following scenarios, you can consider deleting a Kafka topic:
l Topic no longer in use: When a topic is no longer used or needed, you can delete the topic. This could be due to a change in business requirements, data no longer valid, or the topic merged into a different topic.
l Data retention policy change: You can configure data retention policies in Kafka to set the retention period or size of data in a topic. When you need to change your data retention policy, you may need to delete the old Topic and create a new one to apply the new policy.
l Test data cleanup: In a test environment, it is often necessary to clean up old test data to ensure that the environment has free space with good performance. When the test data is no longer needed, the corresponding topics can be deleted to free up resources.
l Topic misconfiguration: When you create a topic, the topic may fail to be created or cannot be used due to configuration errors or misoperations. In this case, you can delete the topics with errors and recreate them with the correct configuration.
It should be noted that before deleting a topic, you need to make sure that the data in the topic has been backed up or is no longer needed. Deleting a topic will permanently delete all data in the topic and the data cannot be recovered. Therefore, before deleting a topic, it is recommended to prepare a backup or confirm that the data is no longer needed.
Procedure
(1) Log in to the management console.
(2) Go to the Kafka console.
(3) In the operation column of the instance list page, click Manage in the target instance row.
(4) Click Topic Management to enter the topic management page, and then click More, and the pop-up window as shown below will appear.
(5) In the topic row, click Delete and select OK.