require 'eventbus/common_init' module EventBus class Queue def Queue.calc_name(base_name, application_id, prod_level, opts = {}) application_id ||= EventBus.application_id prod_level ||= EventBus.PROD_LEVEL global_queue = opts.delete(:global_queue) || false system_queue = opts.delete(:system_queue) || false raise "application_id not set!" if application_id.nil? raise "prod_level not set!" if prod_level.nil? application_id = application_id.downcase prod_level = prod_level.downcase queue_name = base_name unless global_queue == true queue_name = "#{queue_name}.#{prod_level}" queue_name = "#{application_id}.#{queue_name}" unless system_queue end return queue_name end end end