Class: Kafka::Protocol::SyncGroupRequest

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

Instance Method Summary collapse

Constructor Details

#initialize(group_id:, generation_id:, member_id:, group_assignment: {}) ⇒ SyncGroupRequest

Returns a new instance of SyncGroupRequest.


4
5
6
7
8
9
# File 'lib/kafka/protocol/sync_group_request.rb', line 4

def initialize(group_id:, generation_id:, member_id:, group_assignment: {})
  @group_id = group_id
  @generation_id = generation_id
  @member_id = member_id
  @group_assignment = group_assignment
end

Instance Method Details

#api_keyObject


11
12
13
# File 'lib/kafka/protocol/sync_group_request.rb', line 11

def api_key
  14
end

#encode(encoder) ⇒ Object


19
20
21
22
23
24
25
26
27
28
# File 'lib/kafka/protocol/sync_group_request.rb', line 19

def encode(encoder)
  encoder.write_string(@group_id)
  encoder.write_int32(@generation_id)
  encoder.write_string(@member_id)

  encoder.write_array(@group_assignment) do |member_id, member_assignment|
    encoder.write_string(member_id)
    encoder.write_bytes(Encoder.encode_with(member_assignment))
  end
end

#response_classObject


15
16
17
# File 'lib/kafka/protocol/sync_group_request.rb', line 15

def response_class
  SyncGroupResponse
end