Class: Karafka::Cli::Topics::Delete
- Defined in:
- lib/karafka/cli/topics/delete.rb
Overview
Deletes routing based topics
Instance Method Summary collapse
-
#call ⇒ Boolean
True if any topic was deleted, otherwise false.
Methods included from Helpers::Colorize
Instance Method Details
#call ⇒ Boolean
Returns true if any topic was deleted, otherwise false.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/karafka/cli/topics/delete.rb', line 9 def call any_deleted = false declaratives_routing_topics.each do |topic| name = topic.name if existing_topics_names.include?(name) puts "Deleting topic #{name}..." Admin.delete_topic(name) puts "#{green('Deleted')} topic #{name}." any_deleted = true else puts "#{yellow('Skipping')} because topic #{name} does not exist." end end any_deleted end |