getErrorCode

Description

public function getErrorCode(): int {}

Topic partition error code 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 error code: %d',
    $metadata->getTopics()->current()->getPartitions()->current()->getErrorCode()
) . PHP_EOL;