J86
J86

Reputation: 15297

When does Kafka delete a topic?

I am very new to Kafka and I am dabbling about with it.

Say I have Kafka running on a Debian machine and I have managed to create a topic with a 100 messages on it.

After that initial burst of activity (i.e. placing a 100 messages onto the topic via some Kafka Producer) the Topic is just sat there idle with nothing happening (no consumers consuming and no producers producing)

I am aware of a Message Retention Policy setting, which I believe has a default value of 7 days. Let's say those 7 days pass, and the messages are indeed removed from the Topic, but what about the Topic itself?

Will Kafka eventually kill that Topic?

Also, what happens when I manually go and pull out the power cord for the machine that Kafka is running on? Will the Topic be discarded? Or will I still have my topic after I start up the machine, run ZooKeeper and create a Kafka Broker?

Any light on this matter would be appreciated.

Thank you

Upvotes: 1

Views: 2186

Answers (1)

streetturtle
streetturtle

Reputation: 5850

No, Kafka will keep the topic. It sounds like a bad idea that Kafka deletes topics by itself.

Before version 1.0.0 the topic deletion option (delete.topic.enable) was set to false by default. So it wasn't even possible to delete it without changing the config.

So the answer for you question would be Kafka never deletes topics.

Upvotes: 2

Related Questions