Version 26, last updated by Maximiliano Perez Coto at December 23, 2011 10:15 UTC

Setup event processing

Breakout uses a message queue to collect edit events that appear in the stream, such as code commits and ticket edits.  It runs poller scripts to pull events out of this queue and add them to the events table, send email alerts, and run the event processors that are registered to tools which consume events.

For example, a code commit triggers a post-commit hook that puts a commit event in the message queue.  The default poller processor pulls this event and puts it in the event table, so you can see it in the stream.  It also creates email alerts for email alert subscribers, using the Decorators that are associated with the event type.  Then, it passes the event to tools that use events, like the FTP publisher (which might push the changes to an FTP server) or the Webhooks tool (which will send the event to an internal system).

The event queue event architecture (and this description) is based on Ruby RabbitMQ

Install Rubygem Libraries

Configure the Rubygem sources using: sudo gem sources -a http://rubygems.org. Install each gem library using: sudo gem install. The gems to install are:

  • minion

Install RabbitMQ

On ubuntu/debian testing systems:

# apt-get install rabbitmq-server

On stable debian download rabbitmq from testing (from http://www.rabbitmq.com/releases/rabbitmq-server/v1.7.0/rabbitmq-server_1.7.0-1_all.deb)

RabbitMQ 1.8 not working as expected (actually amqp gem) 1.8 is lattest release, but 1.7 release is working.
1.6 (from ubuntu) also working.

Mac OS X Snow Leopard:

brew install rabbitmq

Configure breakout

config/settings_local.yml file:

# other options
# enable event flow through event channel
use_simple_events: false
# use event processor to index objects for site search.
use_system_tool_events: true

# verify that these fields are completed with the smtp server name used to receive email alerts.
# i.e. "gmail.com"
alert_hosts:
tool_<%= FlowsTool::ID %>: gmail.com
tool_<%= TicketTool::ID %>: gmail.com
tool_<%= CustomerSupportTool::ID %>: gmail.com

Restart the breakout application.

Launch the components

  • Launch the queues process in one console: ./script/jobs/development/all.rb
  • RabbitMQ will start automatically from apt-get (and setup to autostart)

Now emails to users will be sent with MQ processor.

If you want to disable the queue later, change :use_simple_events back to true in your settings_local.yml file and restart the breakout application if it is running.