Giter Site home page Giter Site logo

seamusabshere / bunny Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ruby-amqp/bunny

0.0 2.0 0.0 2.62 MB

Bunny is a popular, easy to use, well-maintained Ruby client for RabbitMQ (3.3+)

Home Page: http://rubybunny.info

License: Other

Ruby 99.99% Shell 0.01%

bunny's Introduction

Bunny, a Ruby RabbitMQ Client

Bunny is a RabbitMQ client that focuses on ease of use. It is feature complete, supports all recent RabbitMQ features and does not have any heavyweight dependencies.

I Know What RabbitMQ and Bunny are, How Do I Get Started?

Right here!

What is Bunny Good For?

One can use Bunny to make Ruby applications interoperate with other applications (both built in Ruby and not). Complexity and size may vary from simple work queues to complex multi-stage data processing workflows that involve many applications built with all kinds of technologies.

Specific examples:

  • Events collectors, metrics & analytics applications can aggregate events produced by various applications (Web and not) in the company network.

  • A Web application may route messages to a Java app that works with SMS delivery gateways.

  • MMO games can use flexible routing RabbitMQ provides to propagate event notifications to players and locations.

  • Price updates from public markets or other sources can be distributed between interested parties, from trading systems to points of sale in a specific geographic region.

  • Content aggregators may update full-text search and geospatial search indexes by delegating actual indexing work to other applications over RabbitMQ.

  • Companies may provide streaming/push APIs to their customers, partners or just general public.

  • Continuous integration systems can distribute builds between multiple machines with various hardware and software configurations using advanced routing features of RabbitMQ.

  • An application that watches updates from a real-time stream (be it markets data or Twitter stream) can propagate updates to interested parties, including Web applications that display that information in the real time.

Supported Ruby Versions

Modern Bunny versions support

  • CRuby 2.2, 2.1, 2.0

Bunny works sufficiently well on JRuby but there are known JRuby bugs in versions prior to JRuby 9000 that cause high CPU burn. JRuby users should use March Hare.

Bunny 1.7.x was the last version to support CRuby 1.9.3 and 1.8.7

Supported RabbitMQ Versions

Bunny 1.5.0 (including previews) and later versions only support RabbitMQ 3.3+. Bunny 1.4.x and earlier supports RabbitMQ 2.x and 3.x.

Project Maturity

Bunny is a mature library (started in early 2009) with a stable public API.

Installation & Bundler Dependency

Most Recent Release

Gem Version

With Rubygems

To install Bunny with RubyGems:

gem install bunny

Bundler Dependency

To use Bunny in a project managed with Bundler:

gem "bunny", ">= 2.2.2"

Quick Start

Below is a small snippet that demonstrates how to publish and synchronously consume ("pull API") messages with Bunny.

For a 15 minute tutorial using more practical examples, see Getting Started with RabbitMQ and Ruby using Bunny.

require "bunny"

# Start a communication session with RabbitMQ
conn = Bunny.new
conn.start

# open a channel
ch = conn.create_channel

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

# publish a message to the default exchange which then gets routed to this queue
q.publish("Hello, everybody!")

# fetch a message from the queue
delivery_info, metadata, payload = q.pop

puts "This is the message: #{payload}"

# close the connection
conn.stop

Documentation

Getting Started

For a 15 minute tutorial using more practical examples, see Getting Started with RabbitMQ and Ruby using Bunny.

Guides

Other documentation guides are available at rubybunny.info:

API Reference

Bunny API Reference.

Community and Getting Help

Mailing List

Bunny has a mailing list. We encourage you to also join the RabbitMQ mailing list mailing list. Feel free to ask any questions that you may have.

Continuous Integration

Build Status

News & Announcements on Twitter

To subscribe for announcements of releases, important changes and so on, please follow @rubyamqp on Twitter.

More detailed announcements can be found in the blogs

Reporting Issues

If you find a bug, poor default, missing feature or find any part of the API inconvenient, please file an issue on GitHub. When filing an issue, please specify which Bunny and RabbitMQ versions you are using, provide recent RabbitMQ log file contents if possible, and try to explain what behavior you expected and why. Bonus points for contributing failing test cases.

Running the Specs

The specs require RabbitMQ to be running locally with a specific set of vhosts and users. RabbitMQ can be provisioned and started any that's convenient to you as long as it has a suitable TLS keys configuration and management plugin enabled. Make sure you have a recent version of RabbitMQ (> 3.5.3).

You can also start a clean RabbitMQ server node on your machine specifically for the bunny specs. To do so, run the following command from the base directory of the gem:

RABBITMQ_NODENAME=bunny RABBITMQ_CONFIG_FILE=./spec/config/rabbitmq RABBITMQ_ENABLED_PLUGINS_FILE=./spec/config/enabled_plugins rabbitmq-server

The specs use the RabbitMQ management plugin and require a TLS port to be available. The config files in the spec/config directory enable these.

Next up you'll need to prepare your node for the specs (just once):

RABBITMQ_NODENAME=bunny ./bin/ci/before_build

And then run the core integration suite:

RABBITMQ_NODENAME=bunny CI=true rspec

Other Ruby RabbitMQ Clients

The other widely used Ruby RabbitMQ client is March Hare (JRuby-only). It's a mature library that require RabbitMQ 3.3.x or later.

Contributing

First, clone the repository and run

bundle install --binstubs

then set up RabbitMQ vhosts with

./bin/ci/before_build

(if needed, set RABBITMQCTL env variable to point to rabbitmqctl you want to use)

and then run tests with

CI=true ./bin/rspec -cf documentation spec

After that create a branch and make your changes on it. Once you are done with your changes and all tests pass, submit a pull request on GitHub.

License

Released under the MIT license.

bunny's People

Contributors

michaelklishin avatar celldee avatar carlhoerberg avatar foeken avatar gdb avatar bartj3 avatar dasch avatar priviterag avatar soupmatt avatar tiredpixel avatar xaviershay avatar vesln avatar nviennot avatar justindossey avatar foobarwidget avatar userlocalhost avatar eric avatar aymerick avatar abecciu avatar avlazarov avatar camelpunch avatar ali-graham avatar amatsuda avatar rud avatar bodgit avatar mohenzou avatar nedcampion avatar olleolleolle avatar thedrow avatar inglesp avatar

Watchers

Seamus Abshere avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.