Kafka client for PHP
Solution 1
IMHO the most active Kafka client for PHP is arnaud-lb/php-rdkafka. I managed to compile and run it successfully on OSX and Linux.
Solution 2
Currently (July of 2018) it looks like php-enqueue/enqueue-dev is the leader on github in terms of most stars. It also has the following stats, which are "better" than any of the projects mentioned above, and the latest commit was two days ago.
1,267 commits 24 branches 103 releases 50 contributors
That being said, at the time of this writing, the "build" badge for Kafka says "error", so, you know... caveat lector!
Tín Phạm
Updated on July 19, 2020Comments
-
Tín Phạm almost 4 years
I have a problem with Kafka PHP client on Windows (using xampp). I have installed Apache Kafka 0.8 and tested successfully. Then, I'm finding a PHP client to integrate Kafka to PHP, I just only want to make PHP can produce messages to Kafka (no consume).
By this link: https://cwiki.apache.org/confluence/display/KAFKA/Clients#Clients-PHP I found: https://github.com/EVODelavega/phpkafka
But this PHP Kafka client is being develop and the installation of this extension is more complex (requied librdkafka)
I have tried with other clients but no one work for me.
Does anyone have the same problem with me? Is there simple solution to integrate Kafka to PHP?
-
Elias Van Ootegem over 8 yearsHi, I'm actually developing the phpkafka extension you've linked to in your question. I'm afraid to say that getting it to compile on windows is something that is quite far down on my todo list (the C code is written for C99 compilers, which last I used windows, visual studio did not implement). I also believe that you can't really add extensions to PHP on xampp, or maybe you can't upgrade your PHP version. My advise to you would be: set up a virtual machine that runs linux, and install the extension there. Producing messages on the master version works just fine
-
Roopendra almost 8 yearsDid you get working php client for PHP?
-
Tín Phạm almost 8 yearsNope, I moved to RabbitMQ
-
-
mente over 5 yearsLibrary itself is good but maintainer has low knowledge of kafka and enqueue/rdkafka is not really usable due to multiple bugs
-
Jesse Weigert over 5 yearsThis still depends on arnaud-lb/php-RdKafka which is super buggy
-
SteveB about 5 yearsYeah, kafka part of php-enqueue depends on php-rdkafka - which is a wrapper around C library librdkafka. While usable (I use it for both producing and consuming messages) php-rdkafka might not be stable - especially in edge cases. However, it has the benefit of talking directly to kafka broker instead of http endpoint, which makes it a lot faster.
-
Htoo Maung Thait about 5 yearsYes sure, I also used that php-kafka client arnaud-lb/php-rdkafk yesterday. It works well. It also required to install extension with pecel or manually. You can check in here.