Method: Kafka::Client#alter_topic

Defined in:
lib/kafka/client.rb

#alter_topic(name, configs = {}) ⇒ nil

Note:

This is an alpha level API and is subject to change.

Alter the configuration of a topic.

Configuration keys must match Kafka's topic-level configs.

Examples:

Describing the cleanup policy config of a topic

kafka = Kafka.new(["kafka1:9092"])
kafka.alter_topic("my-topic", "cleanup.policy" => "delete", "max.message.byte" => "100000")

Parameters:

  • name (String)

    the name of the topic.

  • configs (Hash<String, String>) (defaults to: {})

    hash of desired config keys and values.

Returns:

  • (nil)


675
676
677
# File 'lib/kafka/client.rb', line 675

def alter_topic(name, configs = {})
  @cluster.alter_topic(name, configs)
end