getId

Description

public function getId(): int {}

Get host id 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 id: %d', $metadata->getBrokers()->current()->getId()) . PHP_EOL;