class Kafka::Client

def create_topic(name, num_partitions: 1, replication_factor: 1, timeout: 30, config: {})

Returns:
  • (nil) -

Raises:
  • (Kafka::TopicAlreadyExists) - if the topic already exists.

Parameters:
  • config (Hash) -- topic configuration entries. See
  • timeout (Integer) -- a duration of time to wait for the topic to be
  • replication_factor (Integer) -- the replication factor of the topic.
  • num_partitions (Integer) -- the number of partitions that should be created
  • name (String) -- the name of the topic.

Other tags:
    Example: Creating a topic with log compaction -
def create_topic(name, num_partitions: 1, replication_factor: 1, timeout: 30, config: {})
  @cluster.create_topic(
    name,
    num_partitions: num_partitions,
    replication_factor: replication_factor,
    timeout: timeout,
    config: config,
  )
end