Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Bunny is a popular, easy to use, well-maintained Ruby client for RabbitMQ (3.3+)
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin/ci
examples
lib
spec
.gitignore
.rspec
.travis.yml
.yardopts
ChangeLog.md
Gemfile
LICENSE
README.md
bunny.gemspec

README.md

About Bunny

Bunny is a synchronous RabbitMQ client that focuses on ease of use.

Supported Ruby Versions

It supports Ruby 1.9.3, 1.9.2, 1.8.7, Rubinius 2 and JRuby.

Supported RabbitMQ Versions

Bunny versions < 0.7.x support RabbitMQ 1.x and 2.x. Bunny 0.8.x and later versions only supports RabbitMQ 2.x.

Important: Bunny is about to undergo a lot of internal changes

Bunny is a very old library with a lot of missing functionality. It also implements an older version of the spec and may or may not work with future RabbitMQ versions. As such, Bunny is about to undergo serious internal changes. We will make our best to keep them as backwards compatible as possible but within reason.

See this announcement to learn more.

In the meantime, consider using Hot Bunnies (JRuby-only) or amqp gem instead.

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") }

Community & Getting Help

Please use Ruby RabbitMQ clients Google Group for any questions you may have.

For news and updates, follow @rubyamqp on Twitter.

Other Resources

Links

Something went wrong with that request. Please try again.