Method: Kafka::Cluster#get_transaction_coordinator
- Defined in:
- lib/kafka/cluster.rb
#get_transaction_coordinator(transactional_id:) ⇒ Broker
Finds the broker acting as the coordinator of the given transaction.
135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/kafka/cluster.rb', line 135 def get_transaction_coordinator(transactional_id:) @logger.debug "Getting transaction coordinator for `#{transactional_id}`" if transactional_id.nil? # Get a random_broker @logger.debug "Transaction ID is not available. Choose a random broker." return random_broker else get_coordinator(Kafka::Protocol::COORDINATOR_TYPE_TRANSACTION, transactional_id) end end |