- Automatic logging of publishing, receiving, and errors through AMQP
- Built-in event tracking via logging
- Easy to use DSL for listening and publishing of events
- Tight integration with tmm1-amqp so you may take advantage of advanced AMQP features
- Used in Production at Heroku to manage/scale all your apps!
You will need RabbitMQ or another AMQP server installed (only tested with RabbitMQ)
http://www.rabbitmq.com/install.html#generic-unix
- eventmachine (http://github.com/eventmachine/eventmachine/tree/master)
- tmm1-amqp (http://github.com/tmm1/amqp)
- json (http://json.rubyforge.org/)
gem install lizzy
or
Download source from http://github.com/heroku/lizzy
# agent.rb
require 'rubygems'
require 'lizzy'
Lizzy.start({}) do # start AMQP with sensible defaults
Lizzy.listen4("mail.sent") do |listener, info, req|
p [Time.now, :request, req]
# We need to save an attachment. This may take awhile; defer from here
listener.defer do
save_attachment(req[:attachment], "baxter.jpg")
o.publish("attachment.saved", { :filename => "baxter.jpg" })
end
end
end
# send_message.rb
require "rubygems"
require "lizzy"
Lizzy.start do
Lizzy.publish("mail.sent", { :attachment => 'hello world' })
Lizzy.stop_safe
end