mateusjunges/laravel-kafka

Undefined constant "Junges\Kafka\RD_KAFKA_PARTITION_UA"

zanstro opened this issue · 4 comments

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:

Screenshot 2024-02-15 at 4 09 04 PM

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();

@zanstro have you tried restarting php-fpm after installing the extension?

@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.

After a system reboot and running valet install it worked!

This happens to me with valet sometimes, not sure why tho. Anyway, glad it's working now 🙂