Navigation Menu

Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
aemadrid committed Feb 23, 2015
1 parent 88ca86b commit e024c35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/tiki/torch/config.rb
Expand Up @@ -63,7 +63,7 @@ def message_return_handler
end
end

attr_writer :channel_prefetch, :exchange_name
attr_writer :channel_prefetch, :exchange_name, :consumer_queue_prefix

def channel_prefetch
@channel_prefetch || 1
Expand All @@ -89,6 +89,10 @@ def consumer_queue_options
}
end

def consumer_queue_prefix
@consumer_queue_prefix || 'tiki_torch_'
end

def publish_options
@publish_options ||= {
persistent: true,
Expand Down
7 changes: 4 additions & 3 deletions lib/tiki/torch/event_broker.rb
Expand Up @@ -90,9 +90,10 @@ def setup_links
def setup_queues
debug 'Setting up queues ...'
self.class.consumer_registry.each do |consumer_class|
debug "going to setup queue for #{consumer_class.name} : #{consumer_class.queue_name} : #{consumer_class.routing_keys.inspect} ..."
raise "No routing keys for #{consumer_class.name} : #{consumer_class.queue_name}" if consumer_class.routing_keys.empty?
@broker.setup_queue consumer_class.queue_name, consumer_class.routing_keys
queue_name = "#{config.consumer_queue_prefix}#{consumer_class.queue_name}"
debug "going to setup queue for #{consumer_class.name} : #{queue_name} : #{consumer_class.routing_keys.inspect} ..."
raise "No routing keys for #{consumer_class.name} : #{queue_name}" if consumer_class.routing_keys.empty?
@broker.setup_queue queue_name, consumer_class.routing_keys
end
debug 'Done setting up queues ...'
end
Expand Down

0 comments on commit e024c35

Please sign in to comment.