title: How to Delete a topic in apache kafka
body: <p>I need to delete a topic in kafka-0.8.2.2.3. I have used the below command for deleting the topic:</p>
  
  <pre><code>bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic DummyTopic
  </code></pre>
  
  <p>The command executed successfully but when I run a command to list the topics, I could see that the topic is still there and it shows <strong>marked for deletion</strong>.</p>
  
  <pre><code>bin/kafka-topics.sh --list --zookeeper localhost:2181
  DummyTopic - marked for deletion
  </code></pre>
  
  <p>And when I create the topic DummyTopic it outputs the exception, The topic already exists, below is the stack trace:</p>
  
  <pre><code>Error while executing topic command Topic "DummyTopic" already exists.
  kafka.common.TopicExistsException: Topic "DummyTopic" already exists.
      at kafka.admin.AdminUtils$.createOrUpdateTopicPartitionAssignmentPathInZK(AdminUtils.scala:248)
      at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:233)
      at kafka.admin.TopicCommand$.createTopic(TopicCommand.scala:92)
      at kafka.admin.TopicCommand$.main(TopicCommand.scala:54)
      at kafka.admin.TopicCommand.main(TopicCommand.scala)
  </code></pre>
  
  <p>Please let me know how can I delete this topic.</p>