lib/mimi/messaging/kafka/adapter.rb
# Create topic if it does not exist
#
# @param kafka_topic [String] name of the topic to be created
# @param opts [Hash] options to a new topic
#
Create topic if it does not exist
Create topic if it does not exist
def create_topic(kafka_topic, opts = {})
          puts "Creating topic #{kafka_topic} with opts: #{opts}"
          connection.create_topic(kafka_topic, opts)
        rescue ::Kafka::TopicAlreadyExists
          puts "Topic #{kafka_topic} already exists"
          nil
        end
def create_topic ( kafka_topic , opts = { } ) puts "Creating topic #{kafka_topic} with opts: #{opts}" connection . create_topic ( kafka_topic , opts ) rescue :: Kafka :: TopicAlreadyExists puts "Topic #{kafka_topic} already exists" nil end
Create topic if it does not exist
Create topic if it does not exist
kafka_topic
name of the topic to be created
name of the topic to be created
opts
options to a new topic
options to a new topic