getHost

Description

public function getHost(): string {}

Get host name of metadata broker

Example

$conf = new SimpleKafkaClient\Configuration();
$conf->set('auto.offset.reset', 'earliest');
$producer = new SimpleKafkaClient\Producer($conf);
$metadata = $producer->getMetadata(false, 10000);
echo sprintf('Broker host: %s', $metadata->getBrokers()->current()->getHost()) . PHP_EOL;