Undefined constant "Junges\Kafka\RD_KAFKA_PARTITION_UA"
zanstro opened this issue · 4 comments
zanstro commented
I get this error on a fresh Laravel installation (10.44.0) with laravel-kafka: 1.13.10. The php version is 8.1 and rdkafka details are here:
I used the sample code:
use Junges\Kafka\Facades\Kafka;
/** @var \Junges\Kafka\Producers\ProducerBuilder $producer */
$producer = Kafka::publishOn('topic')
->withConfigOptions(['key' => 'value'])
->withKafkaKey('kafka-key')
->withHeaders(['header-key' => 'header-value']);
$producer->send();
mateusjunges commented
@zanstro have you tried restarting php-fpm after installing the extension?
zanstro commented
@mateusjunges first of all thank you for your quick reply and your overall effort. I restarted php-fpm and I ran valet use php@8.1 --force
to relink the php but nothing changed. I also tried with php@8.2 but the issue remains.
zanstro commented
After a system reboot and running valet install
it worked!
mateusjunges commented
This happens to me with valet sometimes, not sure why tho. Anyway, glad it's working now 🙂