php-rdkafka
php-rdkafka copied to clipboard
Exception : RdKafka\Metadata::__construct() has not been called
Description
The following code:
<?php
$metadata = new Metadata;
$metadata->getTopics()
Resulted in this output:
Exception : RdKafka\Metadata::__construct() has not been called
But I expected to get the topics list.
php-rdkafka Version
php-rdkafka 6.0.3
librdkafka Version
1.8.2~1confluent7.2.1-1
PHP Version
php 8.1.8
Operating System
Ubuntu 22.04
Kafka Version
2.6.3
This might be misleading, you need to call an RdKafka or KafkaConsumer instance to get metadata, see doc
Maybe docs or examples can be improved to make this more clear