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.



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

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



13
14
15
# File 'lib/kafka/protocol/sync_group_request.rb', line 13

def api_key
  SYNC_GROUP_API
end

#encode(encoder) ⇒ Object



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

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



17
18
19
# File 'lib/kafka/protocol/sync_group_request.rb', line 17

def response_class
  SyncGroupResponse
end