module RabbitmqHelper

Public Class Methods

publish_event(msg, exchange_name, routing_key) click to toggle source
# File lib/rabbitmq/async/helpers/rabbitmq_helper.rb, line 4
def self.publish_event(msg, exchange_name, routing_key)
  connection = Bunny.new
  connection.start
  channel  = connection.create_channel
  exchange = channel.topic(exchange_name)
  exchange.publish(msg.to_json, :routing_key => routing_key)
  connection.close
end