Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Bunny is a popular synchronous Ruby client for RabbitMQ.
Ruby

This branch is even with ruby-amqp:0.8.x-stable

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
ext
lib
spec/spec_09
.gitignore
.rspec
.travis.yml
.yardopts
CHANGELOG
Gemfile
LICENSE
README.textile
Rakefile
bunny.gemspec

README.textile

Bunny, an easy to use Ruby client for RabbitMQ

Bunny is a synchronous RabbitMQ client. It supports Ruby 1.9.3, 1.9.2, 1.8.7,
Ruby Enterprise Edition and JRuby.

Limited Functionality Disclaimer

Bunny 0.7.x and 0.8.x releases are not feature complete in respect of the AMQP spec or RabbitMQ.

You can use Bunny 0.8.x to:

  • Create and delete exchanges
  • Create and delete queues
  • Publish and synchronously consume messages

But it does not support

  • Arrays, hashes or even symbols in message headers
  • Framing of large messages
  • Many AMQP operations
  • RabbitMQ extensions

The next release (0.9.0) will be feature complete, designed for concurrency,
more efficient and properly documented.

Next Bunny release (0.9.0) will include a lot of internal changes

Bunny is lacking some very useful functionality and as such, is about to undergo serious internal changes.
We will make our best efforts to keep the public API as backwards compatible as possible but within reason.

See the rationale and 0.9.0.pre1 release notes to learn more.

We are also working on porting amqp gem documentation guides to Bunny at rubybunny.info. The docs
cover Bunny 0.9.0 (including `pre` releases) only and are still in early stages.

To follow Bunny 0.9 development, see the master branch.

Which Client to Choose Before 0.9.0 Ships

In the meantime, consider using Hot Bunnies (JRuby) or amqp gem instead. The last release
of Bunny that suports AMQP v0.8 is `0.7.9`. Bunny 0.8.0 only supports AMQP v0.9.1.

Quick Start for Bunny 0.7.x and 0.8.x

require "bunny"

b = Bunny.new(:logging => true)

# start a communication session with the amqp server
b.start

# declare a queue
q = b.queue("test1")

# declare default direct exchange which is bound to all queues
e = b.exchange("")

# publish a message to the exchange which then gets routed to the queue
e.publish("Hello, everybody!", :key => 'test1')

# get message from the queue
msg = q.pop[:payload]

puts "This is the message: " + msg + "\n\n"

# close the connection
b.stop

… or just:

require "bunny"

# Create a direct queue named "my_testq"
Bunny.run { |c| c.queue("my_testq") }

Please see the examples directory for additional usage information.

AMQP Resources

Links

Something went wrong with that request. Please try again.