getId

Description

public function getId(): int {}

Topic partition id reported by broker

Example

$conf = new SimpleKafkaClient\Configuration();
$conf->set('auto.offset.reset', 'earliest');
$producer = new SimpleKafkaClient\Producer($conf);
$metadata = $producer->getMetadata(false, 10000);
echo sprintf(
    'Topic partition id: %d',
    $metadata->getTopics()->current()->getPartitions()->current()->getId()
) . PHP_EOL;