Class: Kafka::Protocol::AddOffsetsToTxnRequest

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

Instance Method Summary collapse

Constructor Details

#initialize(transactional_id: nil, producer_id:, producer_epoch:, group_id:) ⇒ AddOffsetsToTxnRequest

Returns a new instance of AddOffsetsToTxnRequest.



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

def initialize(transactional_id: nil, producer_id:, producer_epoch:, group_id:)
  @transactional_id = transactional_id
  @producer_id = producer_id
  @producer_epoch = producer_epoch
  @group_id = group_id
end

Instance Method Details

#api_keyObject



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

def api_key
  ADD_OFFSETS_TO_TXN_API
end

#encode(encoder) ⇒ Object



21
22
23
24
25
26
# File 'lib/kafka/protocol/add_offsets_to_txn_request.rb', line 21

def encode(encoder)
  encoder.write_string(@transactional_id.to_s)
  encoder.write_int64(@producer_id)
  encoder.write_int16(@producer_epoch)
  encoder.write_string(@group_id)
end

#response_classObject



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

def response_class
  AddOffsetsToTxnResponse
end