PublisherRenoteDac

Short description and motivation.

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem 'publisher_renote_dac'

And then execute:

$ bundle

Or install it yourself as:

$ gem install publisher_renote_dac

Deployment

To generate an initializer run...

rails g publisher_renote_dac:install

Configuration

Configure your publisher_renote_dac.rb initializer file by overriding the necessary defaults such as username and pass, and exhange and queue names. Some configuration options are simple not needed at this time but will be used in future releases.

PublisherRenoteDac.configure do |c|
  # by default bunny rabbitmq server credentials are 'guest' for both username and password by default.
  c.username = 'guest'
  c.password = 'guest'
  c.heartbeat = 2
  c.exchange = 'publisher_renote_dac.email'
  c.exchange_type = :direct
  c.vhost = '/'
  c.rabbitmq_queue = 'consumer_renote_dac.email'
  # c.prod_base_url = ENV['PROD_BASE_URL']
  # c.dev_base_url = 'http://localhost:3000'

  # sets PublisherRenoteDac to inherit directly from parent app ApplicationController. use '::' to get to the root controller
  # defaults to '::ApplicationController'
  c.base_controller = '::ApplicationController'
end

Running

To setup exchange and bind to queues run...

rake publisher_renote_dac:rabbitmq:setup

Production

Heroku Deploy

You can attach RabbitMQ Bigwig to a Heroku application via the CLI

heroku addons:create rabbitmq-bigwig
$=> Adding rabbitmq-bigwig to sharp-mountain-4005... done, v18 (free)

Once you have added RabbitMQ Bigwig you will find RABBITMQ_BIGWIG_TX_URL and RABBITMQ_BIGWIG_RX_URL settings in the app configuration. These contain the canonical URLs used to access the newly provisioned RabbitMQ Bigwig service instance. You can confirm this using the heroku config:get command.

heroku config:get RABBITMQ_BIGWIG_RX_URL
$=> amqp://user:[email protected]/resourceid
heroku config:get RABBITMQ_BIGWIG_TX_URL
$=> amqp://user:[email protected]/resourceid2

make sure to set postmark's api_token env variable on heroku settings tab of the consumer application

POSTMARK_API_TOKEN

rake task for heroku

copy over RABBITMQ_BIGWIG_TX_URL env variable from whatever app you have heroku rabbitmq add-on installed on.

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.