38

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.

  • Did you have any trouble installing?
  • Is it stable?
  • Were there any performance issues?
  • How is the documentation / support?

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.

dkamins
  • 21,450
  • 7
  • 55
  • 59
  • 1
    Hmm, it is subjective indeed and has no definite answers. Might be better suited for *programmers*? – Gordon Dec 10 '10 at 08:35
  • 2
    Maybe, but I'd like to see the discussion. This is a problem our big project is facing at the moment. – aib Dec 10 '10 at 14:50
  • The list of clients is now at http://www.rabbitmq.com/download.html with additional "clients for other languages" at http://www.rabbitmq.com/devtools.html – PapaFreud Apr 16 '13 at 12:35
  • I was wondering is there any update about in 2022? – Qiulang Jul 18 '22 at 03:51

6 Answers6

31

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.

Ian Belcher
  • 5,583
  • 2
  • 34
  • 43
Pieter
  • 606
  • 1
  • 5
  • 7
  • Thanks for posting, @Pieter. Can you comment on the level of ongoing development and resources your team has? How closely (if at all) do you work with or coordinate releases with either the librabbitmq team or RabbitMQ itself (both of which will be changing as AMQP matures to 1.0 etc.)? – dkamins Dec 11 '10 at 06:37
  • 1
    How can we help port it to Windows? What are the dependencies? – aib Dec 11 '10 at 12:32
  • @dkamins: We have two resources that are tasked with keeping this extension bug free and compatible with the latest versions of RabbitMQ and the underlying C client. The latter is experimental, so this is sometimes difficult, but it a production level requirement, so we have to make the effort. We are not at a point where we are coordinating releases yet, but I hope to be able to for the next major versions. – Pieter Dec 12 '10 at 19:00
  • @aib: The dependency is the underlying C library which we use. Much like the memcache extensions, we wrap a standard C library, and since the C library is not 100% on Windows yet, we are stuck. There is a significant push by the entire RabbitMQ community to make it work on Windows, and AFAIK, we are very close to having one. – Pieter Dec 12 '10 at 19:05
  • @Pieter Can you please look into this question with +50 bounty. I am exploring RabbitMq implementation with PHP and will greatly appreciate your help. Thanks http://stackoverflow.com/questions/9151698 – jeff musk Feb 18 '12 at 21:43
  • We are trying to get a script to work for 24/7 in our server ... and I know there are things like heartbeats and keepalive which I can 'hack' in but why aren't there any straight forward way of telling it to not layoff idle consumers (either in the connection constructor and no public way of setting heartbeat)? – Nasaralla Jan 03 '13 at 18:41
  • Also, have a look at this post for compiling rabbitmq-c and installing PECL ampq: http://www.thegeekstuff.com/2013/05/amqp-php-extension/comment-page-1/#comment-757997 – DaveO May 23 '13 at 08:31
  • There seems to be something wrong with the link posted in the answer. Where can I find the end-user documentation for this extension? – Luke Apr 27 '14 at 07:22
  • The other drawback is that you have to be really lucky guy to make it connect over SSL/TLS , with all the certificates issues which will face. – the_root Aug 28 '18 at 12:27
6

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.

Tomas Dermisek
  • 778
  • 1
  • 8
  • 14
  • 2
    I have been using this library with good results so far. Just found my first drawback: when adopting Monolog (https://github.com/Seldaek/monolog) I found out that it depends on the PECL php-amqp module and can't get it to work directly with php-amqplib because it does not expose the AMQPExchange as an object like the previous one. Need to change Monolog's AMQP handler or php-amqplib to mate them correctly. – Rodrigo Neves May 27 '13 at 12:01
3

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

dkamins
  • 21,450
  • 7
  • 55
  • 59
  • Yeah. I prefered php-amqplib because it was most like python-amqplib. I (yes, tom.bioinf is me) wrote the patch that should've been applied, and wouldn't have broken the trunk ;) But there we go. – Tom O'Connor Dec 10 '10 at 22:00
  • @Tom, Are you still using php-amqplib? – dkamins Dec 10 '10 at 23:07
  • Not personally. I wrote that patch when I was at another job, they're still using it, I think, but I doubt they've upgraded since.. In the purposes of testing, I'm more than happy to use php-amqplib again – Tom O'Connor Dec 11 '10 at 11:09
2

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.

aib
  • 45,516
  • 10
  • 73
  • 79
2

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.

dimdm
  • 1,121
  • 1
  • 9
  • 13
  • 1
    According to the documentation to the *tnc* version, it has moved here: https://github.com/videlalvaro/php-amqplib . – Mei May 16 '12 at 16:13
0

We are working on amqp interop. It tries to identify and standardize a common way for PHP programs to create, send, receive and read MQ messages through AMQP to achieve interoperability.

If you place a bet on it you can start with any interop compatible transport. You'll still be able to change it in future, you are not locked in.

We currently supports enqueue/amqp-ext and enqueue/amqp-lib. First one works on top of php amqp extension where another adopts phpamqplib.

Maksim Kotlyar
  • 3,821
  • 27
  • 31