Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (18 sloc) 689 Bytes
#!/usr/bin/env ruby
# encoding: utf-8
require "bundler"
$:.unshift(File.expand_path("../../lib", __FILE__))
require 'amqp' do
connection = AMQP.connect(:host => '')
puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel =
queue = channel.queue("amqpgem.examples.hello_world", :auto_delete => true)
exchange = channel.default_exchange
queue.subscribe do |payload|
puts "Received a message: #{payload}. Disconnecting..."
connection.close { EventMachine.stop }
exchange.publish "Hello, world!", :routing_key =>, :app_id => "Hello world"
Jump to Line
Something went wrong with that request. Please try again.