-
-
Save michaelklishin/4820cfb81491bf980dd8ac404bc3369a to your computer and use it in GitHub Desktop.
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
require 'bunny' | |
connection = Bunny.new | |
connection.start | |
channel = connection.create_channel | |
queue = channel.queue('hello-ret') | |
exch = channel.default_exchange | |
exch.on_return do |return_info, properties, content| | |
puts "Got a returned message : #{content}" | |
puts return_info.inspect | |
puts properties.inspect | |
message = content | |
end | |
exch.publish('Hello World!', routing_key: rand.to_s, mandatory: true) | |
sleep 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment