Sha256: dc872ce8bb6daaee9d6982b49ffa85ba644a814c39b6f7abf9c109628ccd428b
Contents?: true
Size: 985 Bytes
Versions: 19
Compression:
Stored size: 985 Bytes
Contents
# frozen_string_literal: true module Karafka class Cli class Topics < Cli::Base # Creates topics based on the routing setup and configuration class Create < Base # @return [Boolean] true if any topic was created, otherwise false def call any_created = false declaratives_routing_topics.each do |topic| name = topic.name if existing_topics_names.include?(name) puts "#{yellow('Skipping')} because topic #{name} already exists." else puts "Creating topic #{name}..." Admin.create_topic( name, topic.declaratives.partitions, topic.declaratives.replication_factor, topic.declaratives.details ) puts "#{green('Created')} topic #{name}." any_created = true end end any_created end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems