README.textile

Path: README.textile
Last Update: Mon Oct 20 15:05:38 +0000 2014

h1. About bunny

Bunny is a synchronous "AMQP 0.8.0":bit.ly/amqp-model-explained 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.

h2. Limited Functionality Disclaimer

Bunny is very simplistic and does not support many features

You can use Bunny to:

  • Create and delete exchanges
  • Create and delete queues
  • Publish and synchronously consume (basic.get) messages

But it does not support

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

h2. Bunny is NOT actively maintained

Bunny is also **not actively maintained**. Consider using Hot Bunnies (JRuby) or amqp gem instead.

h2. Quick Start

<pre> 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 </pre>

… or just:

<pre> require "bunny"

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

Please see the @examples@ directory for additional usage information.

h2. AMQP Resources

  • "AMQP 0.9.1 model explained":bit.ly/amqp-model-explained - Introductory explanation of the AMQP v0.9.1 specification with particular reference to RabbitMQ

h2. Links

[Validate]