Method: Kafka::Client#topics

Defined in:
lib/kafka/client.rb

#topicsArray<String>

Lists all topics in the cluster.

Returns:

  • (Array<String>)

    the list of topic names.



710
711
712
713
714
715
716
717
718
719
720
# File 'lib/kafka/client.rb', line 710

def topics
  attempts = 0
  begin
    attempts += 1
    @cluster.list_topics
  rescue Kafka::ConnectionError
    @cluster.mark_as_stale!
    retry unless attempts > 1
    raise
  end
end