Skip to content

Will this work with Serverless? #76

Description

@prcongithub

We are using AWS Lambda to run our Ruby on Rails based App. We use SQS to trigger lambda function to process background jobs.

Here is how the handler looks like:

def handler(event:, context:)
  begin
      event = event.with_indifferent_access
      event[:Records].each do |record|
        begin
          RequestStore.store[:seller] = record[:seller]
          AsyncHandler.new(record).handle
        rescue Exception => e
          mail_exception(e, record)
        end  
      end
  rescue Exception => e
    mail_exception(e, event)
  end
end

We are facing this weird issue with batch processing of AWS SQS queue where in the RequestStore is getting cleared in the middle of processing of batch of records.

Somewhere inside the AsyncHandler the RequestStore[:seller] becomes nil.

Any ideas here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions