Last active
August 29, 2015 14:01
-
-
Save inokappa/ca83b5d0b9a6b3c0996a to your computer and use it in GitHub Desktop.
RabbitMQ を Ruby から操作する(send.rb)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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