What is DeleteTopics?
Permanently removes topics and their data via kafka-topics.sh --delete. Returns TOPIC_AUTHORIZATION_FAILED if the caller lacks DELETE permission; in clusters with auto.create.topics.enable=false, deleting a topic that a consumer references causes UNKNOWN_TOPIC_OR_PARTITION until reconfiguration.
| Version | Kafka | Changes |
|---|---|---|
| DeleteTopicsRequest | ||
| v1 | 2.2 | No changes |
| v2 | 2.2 | No changes |
| v3 | 2.2 | No changes |
| v4 | 2.4 | ~ Flexible encoding enabled FLEXIBLE is the first flexible version. |
| v5 | 2.7 | adds ErrorMessage in the response and may return a THROTTLING_QUOTA_EXCEEDED error in the response if the topics deletion is throttled (KIP-599). |
| v6 | 2.8 | + Topics []DeleteTopicState+ Name string+ TopicId uuid- TopicNames []stringreorganizes topics, adds topic IDs and allows topic names to be null. |
| DeleteTopicsResponse | ||
| v1 | 2.2 | + ThrottleTimeMs int32adds the throttle time. |
| v2 | 2.2 | on quota violation, brokers send out responses before throttling. |
| v3 | 2.2 | a TOPIC_DELETION_DISABLED error code may be returned. |
| v4 | 2.4 | ~ Flexible encoding enabled FLEXIBLE is the first flexible version. |
| v5 | 2.7 | + ErrorMessage stringadds ErrorMessage in the response and may return a THROTTLING_QUOTA_EXCEEDED error in the response if the topics deletion is throttled (KIP-599). |
| v6 | 2.8 | + TopicId uuid~ Name became nullableadds topic ID to responses. An UNSUPPORTED_VERSION error code will be returned when attempting to delete using topic IDs when IBP < 2.8. UNKNOWN_TOPIC_ID error code will be returned when IBP is at least 2.8, but the topic ID was not found. |