Skip to content

Commit

Permalink
Merge pull request #170 from dkastner/exchange-options
Browse files Browse the repository at this point in the history
Allow configuration of exchange options
  • Loading branch information
michaelklishin committed Oct 17, 2015
2 parents 5c0b66f + 4b79e72 commit d4dba95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/hutch/broker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ def set_up_amqp_connection
open_channel!

exchange_name = @config[:mq_exchange]
exchange_options = { durable: true }.merge @config[:mq_exchange_options]
logger.info "using topic exchange '#{exchange_name}'"

with_bunny_precondition_handler('exchange') do
@exchange = @channel.topic(exchange_name, durable: true)
@exchange = @channel.topic(exchange_name, exchange_options)
end
end

Expand Down
1 change: 1 addition & 0 deletions lib/hutch/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def self.initialize(params={})
mq_host: 'localhost',
mq_port: 5672,
mq_exchange: 'hutch', # TODO: should this be required?
mq_exchange_options: {},
mq_vhost: '/',
mq_tls: false,
mq_tls_cert: nil,
Expand Down

0 comments on commit d4dba95

Please sign in to comment.