lib/eventbus/queue.rb in eventbus-0.24 vs lib/eventbus/queue.rb in eventbus-0.26
- old
+ new
@@ -1,11 +1,16 @@
+require 'eventbus/common_init'
+
module EventBus
class Queue
- def Queue.calc_name(base_name, application_id = "core", prod_level = ENV['PROD_LEVEL'], opts = {})
+ 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?
@@ -17,10 +22,9 @@
unless global_queue == true
queue_name = "#{queue_name}.#{prod_level}"
queue_name = "#{application_id}.#{queue_name}" unless system_queue
end
- puts "Calculated queue name: #{queue_name}"
return queue_name
end
end
\ No newline at end of file