Class: Kafka::Protocol::ConsumerGroupProtocol

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

Instance Method Summary collapse

Constructor Details

#initialize(version: 0, topics:, user_data: nil) ⇒ ConsumerGroupProtocol

Returns a new instance of ConsumerGroupProtocol.



6
7
8
9
10
# File 'lib/kafka/protocol/consumer_group_protocol.rb', line 6

def initialize(version: 0, topics:, user_data: nil)
  @version = version
  @topics = topics
  @user_data = user_data
end

Instance Method Details

#encode(encoder) ⇒ Object



12
13
14
15
16
# File 'lib/kafka/protocol/consumer_group_protocol.rb', line 12

def encode(encoder)
  encoder.write_int16(@version)
  encoder.write_array(@topics) {|topic| encoder.write_string(topic) }
  encoder.write_bytes(@user_data)
end