Class: Kafka::Protocol::TopicMetadataRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/kafka/protocol/topic_metadata_request.rb

Instance Method Summary collapse

Constructor Details

#initialize(topics: []) ⇒ TopicMetadataRequest

A request for cluster metadata.

Parameters:

  • topics (Array<String>) (defaults to: [])

8
9
10
# File 'lib/kafka/protocol/topic_metadata_request.rb', line 8

def initialize(topics: [])
  @topics = topics
end

Instance Method Details

#api_keyObject


12
13
14
# File 'lib/kafka/protocol/topic_metadata_request.rb', line 12

def api_key
  3
end

#encode(encoder) ⇒ Object


20
21
22
# File 'lib/kafka/protocol/topic_metadata_request.rb', line 20

def encode(encoder)
  encoder.write_array(@topics) {|topic| encoder.write_string(topic) }
end

#response_classObject


16
17
18
# File 'lib/kafka/protocol/topic_metadata_request.rb', line 16

def response_class
  Protocol::MetadataResponse
end