Class: Kafka::Protocol::EndTxnRequest

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

Instance Method Summary collapse

Constructor Details

#initialize(transactional_id:, producer_id:, producer_epoch:, transaction_result:) ⇒ EndTxnRequest

Returns a new instance of EndTxnRequest


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

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

Instance Method Details

#api_keyObject


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

def api_key
  END_TXN_API
end

#encode(encoder) ⇒ Object


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

def encode(encoder)
  encoder.write_string(@transactional_id)
  encoder.write_int64(@producer_id)
  encoder.write_int16(@producer_epoch)
  encoder.write_boolean(@transaction_result)
end

#response_classObject


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

def response_class
  EndTxnResposne
end