rabbitmq-tutorials/ruby/send.rb
2013-07-17 18:21:48 +04:00

17 lines
260 B
Ruby

#!/usr/bin/env ruby
# encoding: utf-8
require "bunny"
conn = Bunny.new
conn.start
ch = conn.create_channel
q = ch.queue("hello")
ch.default_exchange.publish("Hello World!", :routing_key => q.name)
puts " [x] Sent 'Hello World!'"
sleep 0.5
conn.close