There is a list of PHP clients on the RabbitMQ site. I'm asking this question in hopes that people who have used any of these can share their experiences here. E.g.
Even if you've just used one of these libraries, please share your experiences.
For reference, here are some of the clients listed:
P.S. I know that "Best ..." is "subjective", but the point of this question is to collect experiences and help people make an informed decision about these AMQP libraries. Please don't knee-jerk close this question just because it has the word "best" in it.
P.P.S. I'm using PHP 5.3 on RHEL 5.
PHP is a popular server-side scripting language with an officially recognized RabbitMQ library. The php-amqplib package is a pure PHP implementation of the AMQP 0.9. 1 protocol. In this article, we will show how to install and use php-amqplib through a RabbitMQ PHP example.
Overview. The RabbitMQ Java client library allows Java and JVM-based applications to connect to and interact with RabbitMQ nodes.
In order for a client to interact with RabbitMQ it must first open a connection. This process involves a number of steps: Application configures the client library it uses to use a certain connection endpoint (e.g. hostname and port) The library resolves the hostname to one or more IP addresses.
For reference, PECL AMQP Extension and http://php.net/manual/fa/book.amqp.php are the same thing, one is the package, the other the documentation for the package.
As a maintainer of the official PHP AMQP extension, I am a little biased. Many people use this extension in high volume low latency production environments since it is far faster than one written in native PHP. Furthermore, since I constantly use this at my job, I have to keep it working and up to date.
The drawback to this extension is that it is not available for Windows, yet, because the library on which it depends is currently being ported. There is not ETA for Windows support, but as soon as the dependencies support Windows, it is our goal to port the extension over to Windows as well.
This library seem to be alive and succeeding the original from code.google:
https://github.com/videlalvaro/php-amqplib
There are also tests and Travis CI.
Some info from initial review:
https://github.com/tnc/php-amqplib forked http://code.google.com/p/php-amqplib/ at an unknown point in the past and does not have a clear history or show what was changed, which results in an unfortunate fragmentation of efforts. It also appears to NOT be keeping up with bugfixes being applied to the original, a number of which have come in the last few months.
Also http://code.google.com/p/php-amqplib/ itself now appears to be no longer under active development, and a bad patch was applied over a month ago leaving the trunk in a broken state. (I submitted a patch to fix that, but this is a bad sign).
Having looked at both php-amqp and the PECL version, my impressions are that basic support for publishing and consuming messages is implemented. However, they will only work out of the box on *NIX platforms. You will have to jump through hoops to make them work on Windows (which may or may not be a problem depending on your development or deployment platform).
Bonus: https://github.com/tnc/php-amqplib is used in the MEAP book "RabbitMQ in Action". Whether that will have any influence on its adoption remains to be seen.
There's also https://github.com/bkw/php-amqp/ which I think is a mirror of http://code.google.com/p/php-amqplib/. I've had some trouble with that code: Notice messages during normal operation and all kinds of errors and warnings when there's something wrong. The code also takes the PHP manual's word for granted; for example, socket read calls are only checked against an error return, while in fact I'm just discovering that a socket close/timeout may be indicated by any of 4 different conditions.
I'm starting to think that a compiled library solution (i.e. a PHP extension) is the best option, particularly since there're threading and socket issues, and PHP handles both poorly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With