Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'amqp'
- EventMachine.run do
- connection = AMQP.connect(:host => '127.0.0.1', :username => 'guest', :password => 'guest')
- puts "Connecting to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
- channel = AMQP::Channel.new(connection)
- queue = channel.queue("rubyqueue", :auto_delete => true)
- exchange = channel.default_exchange
- queue.subscribe do |payload|
- puts "Received a message: #{payload}."
- end
- end
Add Comment
Please, Sign In to add comment