Skip to content

Instantly share code, notes, and snippets.

@inokappa
Last active August 29, 2015 14:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
RabbitMQ を Ruby から操作する(send.rb)
#!/usr/bin/env ruby
# encoding: utf-8
require "bunny"
conn = Bunny.new(:hostname => "localhost")
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!'"
conn.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment