Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The most popular synchronous Ruby AMQP 0.9.1 client
Ruby
branch: master

This branch is 1273 commits behind ruby-amqp:master

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

About bunny

Bunny is a synchronous AMQP client. It supports Ruby 1.9.2, 1.8.7, Ruby Enterprise Edition and JRuby. Protocol-wise, Bunny supports AMQP 0.9.1 and 0.8. Support for AMQP 0.8 will be dropped in the next version of Bunny (0.8) because most of popular AMQP brokers such as RabbitMQ have already stopped or are planning to stop supporting it in the near future.

Bunny is based on a great deal of useful code from the amqp Ruby gem and Carrot.

You can use Bunny to:

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

Quick Start

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.