-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MattT/APPEALS-51115: Initialize FIFO SQS Queues Locally (#22182)
* Set local env to utilize FIFO queues where appropriate FIFO queues are configured with the same attributes as our queues in higher environments. * Resolve failing test * Remove defunct test * Update make commands --------- Co-authored-by: Matthew Thornton <ThorntonMatthew@users.noreply.github.com>
- Loading branch information
1 parent
f8d667b
commit 629796f
Showing
8 changed files
with
54 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
# Initializes SQS message queues not for intended for use with | ||
# asynchronous jobs. | ||
# | ||
# This will primarily be utilized in our development and demo environments. | ||
|
||
QUEUE_PREFIX = "caseflow_#{ENV['DEPLOY_ENV']}_" | ||
|
||
MESSAGE_QUEUES = [ | ||
{ | ||
name: "receive_notifications.fifo", | ||
attributes: { | ||
"FifoQueue" => "true", | ||
"FifoThroughputLimit" => "perQueue" | ||
} | ||
} | ||
].freeze | ||
|
||
if Rails.application.config.sqs_create_queues | ||
sqs_client = Aws::SQS::Client.new | ||
sqs_client.config[:endpoint] = URI(Rails.application.config.sqs_endpoint) | ||
|
||
MESSAGE_QUEUES.each do |queue_info| | ||
sqs_client.create_queue({ | ||
queue_name: "#{QUEUE_PREFIX}#{queue_info[:name]}".to_sym, | ||
attributes: queue_info[:attributes] | ||
}) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters