The Messenger SQS Listener polls SQS for messages and passes them to the active worker.
Add this line to your application's Gemfile:
gem 'messenger-listeners-sqs', git: '[email protected]:unbounce/messenger-listeners-sqs.git'
And then execute:
$ bundle
You must set which listener and worker the messenger will use. To create a configuration
file in your application, run rails g messenger-listeners-sqs:install
. Set the appropriate
queue url and any other options.
# Example config/initializers/messenger-listeners-sqs.rb
Messenger::Listeners::Sqs.configure do |config|
config.queue_url = 'https://some-sqs-queue-url'
# config.batch_size = 10
# config.visibility_timeout = 10
# config.wait_time = 20
end
Your messenger must also be set to use this listener, so in config/initializers/messenger.rb
set config.listener_type = :sqs
.
See Messenger's README.