Watership
Watership is a wrapper around Bunny. It attempts to catch connection issues to the RabbitMQ server and provide a fake backend, switching back to the real backend when it becomes available.
It is currently being used in production on a set of applications, but be warned that it's still early in its life.
Dependencies
Watership requires Ruby 2 or higher.
Installation
Add this line to your application's Gemfile:
gem 'watership'
And then execute:
$ bundle
Or install it yourself as:
$ gem install watership
Usage
This is meant for our specific use case, but if you want to give it a go....
Once you've require
d it, you configure Watership with:
postamt = Watership.register(:postamt, '[POSTAMT AMQP URI]')
Optionally, you can set a logger (Watership.logger = ...
) and specify the environment (Watership.environment = ...
).
Then, connect to your RabbitMQ instance with:
postamt.reconnect
Finally, you push messages like this:
postamt.enqueue(queue: 'queue name', message: {message: :to_enque})
Contributing
- Fork it ( http://github.com/bscofield/watership/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request