diff --git a/lib/active_elastic_job/railtie.rb b/lib/active_elastic_job/railtie.rb index 66796a5..0123d86 100644 --- a/lib/active_elastic_job/railtie.rb +++ b/lib/active_elastic_job/railtie.rb @@ -1,7 +1,10 @@ module ActiveElasticJob class Railtie < Rails::Railtie initializer "active_elastic_job.insert_middleware" do |app| - app.config.middleware.use "ActiveElasticJob::Rack::SqsMessageConsumer" + disabled = ENV['DISABLE_SQS_CONSUMER'] + if disabled == 'false' || disabled.nil? + app.config.middleware.use "ActiveElasticJob::Rack::SqsMessageConsumer" + end end end end