Skip to content

Instantly share code, notes, and snippets.

@dangerousbeans
Created June 5, 2013 10:44
Show Gist options
  • Save dangerousbeans/5713060 to your computer and use it in GitHub Desktop.
Save dangerousbeans/5713060 to your computer and use it in GitHub Desktop.
require "rubygems"
require "amqp"
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1')
channel = AMQP::Channel.new(connection)
low_queue = channel.queue("low")
high_queue = channel.queue("high")
exchange = channel.direct("")
10.times do
exchange.publish "LOW", :routing_key => low_queue.name
end
10.times do
exchange.publish "HIGH", :routing_key => high_queue.name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment