Class: Kafka::Protocol::JoinGroupResponse

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

Defined Under Namespace

Classes: Metadata

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code:, generation_id:, group_protocol:, leader_id:, member_id:, members:) ⇒ JoinGroupResponse

Returns a new instance of JoinGroupResponse.



14
15
16
17
18
19
20
21
# File 'lib/kafka/protocol/join_group_response.rb', line 14

def initialize(error_code:, generation_id:, group_protocol:, leader_id:, member_id:, members:)
  @error_code = error_code
  @generation_id = generation_id
  @group_protocol = group_protocol
  @leader_id = leader_id
  @member_id = member_id
  @members = members
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



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

def error_code
  @error_code
end

#generation_idObject (readonly)

Returns the value of attribute generation_id.



10
11
12
# File 'lib/kafka/protocol/join_group_response.rb', line 10

def generation_id
  @generation_id
end

#group_protocolObject (readonly)

Returns the value of attribute group_protocol.



10
11
12
# File 'lib/kafka/protocol/join_group_response.rb', line 10

def group_protocol
  @group_protocol
end

#leader_idObject (readonly)

Returns the value of attribute leader_id.



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

def leader_id
  @leader_id
end

#member_idObject (readonly)

Returns the value of attribute member_id.



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

def member_id
  @member_id
end

#membersObject (readonly)

Returns the value of attribute members.



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

def members
  @members
end

Class Method Details

.decode(decoder) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/kafka/protocol/join_group_response.rb', line 23

def self.decode(decoder)
  new(
    error_code: decoder.int16,
    generation_id: decoder.int32,
    group_protocol: decoder.string,
    leader_id: decoder.string,
    member_id: decoder.string,
    members: Hash[
      decoder.array do
        member_id = decoder.string
        d = Decoder.from_string(decoder.bytes)
        [member_id, Metadata.new(d.int16, d.array { d.string }, d.bytes)]
      end
    ],
  )
end