[rabbitmq-discuss] Important: the future of Bunny (a Ruby RabbitMQ client)

Michael Klishin michael.s.klishin at gmail.com
Sat Jun 23 02:56:29 BST 2012


First, a little announcement: I released Bunny 0.8.0 to rubygems.org [1]. This release
is identical to 0.7.9 and will be used as a mark for the last release of Bunny that implements AMQP 0.8.

Now, to the fun part.

Bunny is a library with complicated history: it is old, very feature incomplete, not maintained, has odd API decisions, has
no documentation and is stuck at AMQP 0.8. In addition, it does not frame message bodies, which means with
future RabbitMQ versions it will not be possible to send messages larger than the size of one frame (typically 128K).

Over the years nobody took over Bunny's maintainership, resulting in a crazy number of forks each fixing an issue or
two in a very ad-hoc manner. Sometimes this involved copying some amqp gem code in a haste to support URI connections
for Heroku. Sometimes it involved reinventing half of what's already available in the amq-protocol gem just to get
array and map (attribute tables) serialization in message headers.

Needless to say, this is not a healthy situation for a library to be in.

At the same time, Bunny is popular and I can see why certain people, companies and users cannot move to Hot Bunnies (which is JRuby-only) or deal with EventMachine that amqp gem uses. There are popular PaaS providers that use
Bunny in their doc examples because of the simplicity. OpsCode Chef still seems to depend on Bunny. And the list goes on.

This cannot go on forever. At some point, projects that rely on Bunny with either get stuck with old RabbitMQ versions
or will simply break. Both options really suck.

So I decided to do to Bunny what we did to amqp gem in 2010 and 2011: rewrite it from scratch, make it feature complete
and keep it backwards compatible where possible, but within reason. It worked well for amqp gem and besides
Ruby 1.8.7-p249 users (amqp gem does not support that particular patch level because it has a serious bug that would
require rewriting half of the library to work around), all non-trivial codebases that use amqp gem eventually upgraded to 0.8.x and now 0.9.x with very little or no effort.

Some highlights of what I have in mind:

* Move to AMQP 0.9.1, use amq-protocol that is a standalone library with pretty good test coverage, no I/O parts (only pure functions) and which is based on rabbitmq-codegen, a tool that official clients suck as the Java one use.
* Rewrite Bunny's test suite which is, hm, not particularly complete
* Make Bunny as feature complete as amqp gem and Hot Bunnies
* Provide lower-level, non-OO (AMQP is not OO, as are most of network protocols) client
* Deprecate but not remove oddities current Bunny API has
* Avoid race conditions and other known fundamental problems Bunny has thanks to the way it implements network communication

I am not sure what to do about the docs yet. Porting rubyamqp.info guides for Bunny is definitely not as much work as it
took to write them but it almost certainly will take a month or more. I may or may not be motivated enough to do that.

The fun starts on July 1st when I go on a vacation.


A short FAQ for Bunny users:

** Who are you? Why should I trust you to make sweeping changes to Bunny? Our CTO wants to know!

I main amqp gem, Langohr (a Clojure client), co-maintain Hot Bunnies with Theo Hultberg and have been using and
digging in internals of the Java client on and off for a few years.

On top of that, I wrote all doc guides at http://rubyamqp.info/. Chris Duncan, the original author of Bunny, helped me with editing them.

In other words, I am pretty qualified to design and write an AMQP 0.9.1 client, in any language.
Possibly even more qualified than your CTO.


** Will my code break?

We will do our best to break as little as possible. It is doable, as amqp gem experience shows.


** Why do I need AMQP 0.9.1?

AMQP 0.8 may or may not be around after a few RabbitMQ releases. Regardless of the exact version, the
goal is to make Bunny feature complete and all reasonably well maintained RabbitMQ clients have moved on to
AMQP 0.9.1.

In addition, you will be able to use RabbitMQ extensions to AMQP 0.9.1. Some of them are very powerful.


** Do you even realize why Bunny users use Bunny?

Yes. Because of the simplicity. We will make sure to preserve this nice aspect of Bunny, don't worry.


** Will you use EventMachine?

No, absolutely not. I am as tired of jumping through the hoops to not block the event loop as you are.
We will use that old boring TCP sockets thing.




1. https://rubygems.org/gems/bunny/versions/0.8.0

MK

michael at defprotocol.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120623/c3a26877/attachment.pgp>


More information about the rabbitmq-discuss mailing list