Guest User

Untitled

a guest
Jun 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. # == RabbitMQ Subscriber
  2.  
  3. require 'rubygems'
  4. require 'mq'
  5.  
  6. AMQP.start(:host => 'dev.rabbitmq.com') do
  7.  
  8. MQ.queue("notifications").bind( MQ.topic('notifications'), :key => "notifications.*").subscribe do |header, body|
  9. puts "Received message:"
  10. p header
  11. p body
  12. end
  13.  
  14. end
Add Comment
Please, Sign In to add comment