Advertisement
Guest User

Untitled

a guest
Nov 6th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. require "bunny"
  2.  
  3. # Start a communication session with RabbitMQ
  4. conn = Bunny.new(user: 'SIBEXT', pass: 'X44HG54')
  5. conn.start
  6.  
  7. # open a channel
  8. channel = conn.create_channel
  9.  
  10. # declare a queue
  11. queue = channel.queue("events")
  12.  
  13. data = {action: 'new',
  14. unit_token: '70e9c5a2d6b180df391c0fda2c3579277fdace70',
  15. date: Time.now,
  16. type: 'type',
  17. identifier: '01',
  18. data: 'data'}
  19.  
  20. queue.publish(data.to_json)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement