Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # encoding: utf-8
- require "rubygems"
- require "bundler"
- Bundler.setup
- require 'amqp'
- EventMachine.run do
- connection = AMQP.connect(:host => 'localhost', :user => 'guest', :pass => 'guest')
- puts "Connecting to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
- channel = AMQP::Channel.new(connection)
- queue = channel.queue("reservations.local")
- exchange = channel.default_exchange
- puts "publishing"
- exchange.publish "test", :routing_key => 'reservations.local', :ack => true
- connection.close { EventMachine.stop }
- end
Add Comment
Please, Sign In to add comment