Created
October 26, 2018 01:13
-
-
Save claudijd/032f6979525803cf5d9b16612a6db3a8 to your computer and use it in GitHub Desktop.
amqp agent
This file contains hidden or 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" | |
# Start a communication session with RabbitMQ | |
conn = Bunny.new | |
conn.start | |
ch = conn.create_channel | |
q = ch.queue("test1") | |
loop do | |
delivery_info, metadata, payload = q.pop | |
if payload | |
puts "Scan: #{payload}" | |
end | |
sleep 1 | |
end | |
conn.stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment