Module: Aws::Rails

Defined in:
lib/aws/rails/railtie.rb,
lib/aws-sdk-rails.rb,
lib/aws/rails/notifications.rb,
lib/aws/rails/middleware/elastic_beanstalk_sqsd.rb

Overview

Use the Rails namespace.

Defined Under Namespace

Modules: Middleware Classes: Notifications, Railtie

Constant Summary collapse

VERSION =
File.read(File.expand_path('../VERSION', __dir__)).strip

Class Method Summary collapse

Class Method Details

.add_sqsd_middleware(app) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



61
62
63
64
65
66
67
68
69
70
# File 'lib/aws/rails/railtie.rb', line 61

def add_sqsd_middleware(app)
  return unless ENV['AWS_PROCESS_BEANSTALK_WORKER_REQUESTS']

  if app.config.force_ssl
    # SQS Daemon sends requests over HTTP - allow and process them before enforcing SSL.
    app.config.middleware.insert_before(::ActionDispatch::SSL, Aws::Rails::Middleware::ElasticBeanstalkSQSD)
  else
    app.config.middleware.use(Aws::Rails::Middleware::ElasticBeanstalkSQSD)
  end
end