Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "bunny"
- # Start a communication session with RabbitMQ
- conn = Bunny.new(user: 'SIBEXT', pass: 'X44HG54')
- conn.start
- # open a channel
- channel = conn.create_channel
- # declare a queue
- queue = channel.queue("events")
- data = {action: 'new',
- unit_token: '70e9c5a2d6b180df391c0fda2c3579277fdace70',
- date: Time.now,
- type: 'type',
- identifier: '01',
- data: 'data'}
- queue.publish(data.to_json)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement