getPort
public function getPort(): int {}
Get host port of metadata broker
$conf = new SimpleKafkaClient\Configuration();
$conf->set('auto.offset.reset', 'earliest');
$producer = new SimpleKafkaClient\Producer($conf);
$metadata = $producer->getMetadata(false, 10000);
echo sprintf('Broker port: %d', $metadata->getBrokers()->current()->getPort()) . PHP_EOL;