Skip to content

Commit fa5c5af

Browse files
committed
Improve the docs for Client#describe_topic
1 parent 4145ba1 commit fa5c5af

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/kafka/client.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,21 @@ def delete_topic(name, timeout: 30)
473473
@cluster.delete_topic(name, timeout: timeout)
474474
end
475475

476-
# Describe configs of a topic.
476+
# Describe the configuration of a topic.
477+
#
478+
# Retrieves the topic configuration from the Kafka brokers. Configuration names
479+
# refer to [Kafka's topic-level configs](https://kafka.apache.org/documentation/#topicconfigs).
480+
#
481+
# @note This is an alpha level API and is subject to change.
482+
#
483+
# @example Describing the cleanup policy config of a topic
484+
# kafka = Kafka.new(seed_brokers: ["kafka1:9092"])
485+
# kafka.describe_topic("my-topic", ["cleanup.policy"])
486+
# #=> { "cleanup.policy" => "delete" }
477487
#
478488
# @param name [String] the name of the topic.
479489
# @param configs [Array<String>] array of desired config names.
480-
# @return [Hash<string, string>]
490+
# @return [Hash<String, String>]
481491
def describe_topic(name, configs = [])
482492
@cluster.describe_topic(name, configs)
483493
end

0 commit comments

Comments
 (0)