Skip to content

Commit

Permalink
Use environment specific retry queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Sep 17, 2019
1 parent 60a2f12 commit 127133c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/workers/figgy_event_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class FiggyEventHandler
include Sneakers::Worker
from_queue :"pomegranate_#{Rails.env}",
WORKER_OPTIONS.merge(
arguments: { 'x-dead-letter-exchange': 'pomegranate-retry' }
arguments: { 'x-dead-letter-exchange': "pomegranate_#{Rails.env}-retry" }
)

def work(msg)
Expand Down
3 changes: 3 additions & 0 deletions spec/workers/figgy_event_handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
expect(FiggyEventProcessor).to have_received(:new).with(msg)
expect(handler).to have_received(:ack!)
end
it "is configured to use an environment specific deadletter queue" do
expect(described_class.queue_opts[:arguments][:"x-dead-letter-exchange"]).to eq "pomegranate_test-retry"
end
end
end

0 comments on commit 127133c

Please sign in to comment.