getErrorCode

Description

public function getErrorCode(): int {}

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