Skip to content

Instantly share code, notes, and snippets.

@claudijd
Created October 26, 2018 01:13
Show Gist options
  • Save claudijd/032f6979525803cf5d9b16612a6db3a8 to your computer and use it in GitHub Desktop.
Save claudijd/032f6979525803cf5d9b16612a6db3a8 to your computer and use it in GitHub Desktop.
amqp agent
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