Sha256: 2a3811675e985eedc09afa570b2ff3fc908aee53d52d1e7c2921574dc03e1613

Contents?: true

Size: 1.96 KB

Versions: 3

Compression:

Stored size: 1.96 KB

Contents

# Introduction

Manage RabbitMQ structure of your virtual hosts. Similary to ActiveRecord schema.rb or structure.sql that dumps the current database schema, rabbitmq-schema will dump a ```db/rabbitmq_structure.json``` timestamped file with the representation of the virtual hosts, queues, exchanges, bindings, users and permissions.

## Installation

Include this to your development/test Gemfile:

```ruby
  gem 'rabbitmq-schema'
```

## Usage

Make sure you set an environment variable for the rabbitmq api (you can add the /api path or leave it out):
```
RABBITMQ_MANAGEMENT_URL=http://guest:guest@localhost:15672
```

### Create definition

Create a new vhost and definition for your application. It will create the vhosts of your choice and add permissions to the user in the environment variable to those vhosts.
```ruby
  bundle exec rake rabbitmq:create          # It will ask you what vhosts to create the definition with
  # or
  bundle exec rake rabbitmq:create[/hats] # It will directly create a vhost named '/hats' 
```

### Drop definition

Drop the vhosts in from your RabbitMQ instance and remove the file:
```ruby
  bundle exec rake rabbitmq:drop
```

### Dump definition
Dump the definition of the vhosts in your RabbitMQ instance into definition file:
```ruby
  bundle exec rake rabbitmq:dump           # To dump the vhosts specificed in the existing definition file
  # or 
  bundle exec rake rabbitmq:dump[/hats] # To dump the specified vhost in a new definition few
```

### Load definition
Load the vhosts definition from your definition file into your RabbitMQ instance:
```ruby
  bundle exec rake rabbitmq:load
```

### TODO

- [ ] Make it Rails independent
      - [ ] There's a few uses of Hash#except.
      - [ ] There's a few uses of Hash#with_indifferent_access.
      - [ ] The Engine class should only be loaded when Rails is present.
      - [ ] User should be able to indicate the file path for the structure.
      - [ ] Rails dependency should be removed from gemspec.

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rabbitmq-definition-0.1.2 README.md
rabbitmq-definition-0.1.1 README.md
rabbitmq-definition-0.1.0 README.md