Skip to content

Commit

Permalink
Merge branch 'anuonifade-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Nov 8, 2024
2 parents 61b3d87 + 04c2502 commit 723da1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/sneakers/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Sneakers
class Configuration

extend Forwardable
def_delegators :@hash, :to_hash, :[], :[]=, :==, :fetch, :delete, :has_key?
def_delegators :@hash, :to_hash, :[], :[]=, :==, :fetch, :delete, :has_key?, :dig

EXCHANGE_OPTION_DEFAULTS = {
:type => :direct,
Expand Down
8 changes: 6 additions & 2 deletions lib/sneakers/handlers/maxretry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ def initialize(channel, queue, opts)

def self.configure_queue(name, opts)
retry_name = opts.fetch(:retry_exchange, "#{name}-retry")
opt_args = opts[:queue_options][:arguments] ? opts[:queue_options][:arguments].inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} : {}
opts[:queue_options][:arguments] = { :'x-dead-letter-exchange' => retry_name }.merge(opt_args)
opt_args = if opts.dig(:queue_options, :arguments).blank?
{}
else
opts.dig(:queue_options, :arguments).transform_keys(&:to_sym)
end
opts[:queue_options][:arguments] = { :'x-dead-letter-exchange' => retry_name }.merge!(opt_args)
opts[:queue_options]
end

Expand Down

0 comments on commit 723da1f

Please sign in to comment.