Sneakers Queue Migrator
A Ruby gem to safely migrate RabbitMQ queues when queue arguments change, with dynamic Sneakers subscriber discovery, queue argument comparison, and safe message shoveling.
Features
- Discovers all Sneakers subscribers dynamically
- Compares current and desired queue arguments using the RabbitMQ Management API
- Safely migrates messages between queues using Bunny
- Exposes a class-based API for integration
- Optionally provides a Rake task for Rails apps
Installation
Add this line to your application's Gemfile:
gem 'sneakers-queue-migrator'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install sneakers-queue-migrator
Usage
You need the sneakers or kicks gem for this to work
require 'sneakers/migrator'
# Example usage (API subject to change)
Sneakers::Migrator.migrate!(
amqp_url: 'amqp://user:password@rabbitmq:5672/',
amqp_api_url: 'http://user:password@rabbitmq:15672',
subscriber_paths: ['app/workers']
)
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests.
Contributing
Bug reports and pull requests are welcome!
License
MIT