Created
April 30, 2021 19:03
-
-
Save LyricL-Gitster/487b31193f8dd23d07bddcbe042a542c to your computer and use it in GitHub Desktop.
configure Shoryuken with potentially mocked SQS
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
# initialize moto SQS queue for dev environment | |
if Rails.env.development? | |
sqs = Aws::SQS::Client.new( | |
access_key_id: ENV["AWS_ACCESS_KEY_ID"], | |
region: ENV["AWS_REGION"], | |
endpoint: "http://localhost:4576/", | |
secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"], | |
verify_checksums: false | |
) | |
begin | |
ENV["PARSED_QUEUE_NAME"] = sqs.create_queue(queue_name: ENV['SQS_QUEUE_NAME']).queue_url | |
rescue Seahorse::Client::NetworkingError => e | |
puts "Unable to connect to SQS to create dev queue" | |
end | |
end | |
# Rely on ENV["PARSED_QUEUE_NAME"] throughout rest of application | |
ENV["PARSED_QUEUE_NAME"] ||= ENV['SQS_QUEUE_NAME'] | |
Shoryuken::EnvironmentLoader.setup_options(config_file: 'config/shoryuken.yml') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
should be located at
config/initializers/shoryuken.rb