Git Product home page Git Product logo

delayed_job_sqs's Introduction

This is an Amazon SQS backend for delayed_job

Getting Started

Get credentials

Configure AWS with:

AWS.config(
  :access_key_id => 'XXXXXX',
  :secret_access_key => 'XXXXXX',
  :region => 'XXXXXX')

One and only one worker's queue must be defined:

Delayed::Worker.queues = [:some_queue]
# or with URL to avoid SQS requests
Delayed::Backend::Sqs.queue_url = 'https://sqs.us-west-2.amazonaws.com/146382271533/some_queue'
Delayed::Backend::Sqs.queue_url = AWS::SQS.new.queue.named(:some_queue).url

If many queue are defined, only the first one will be used. When enqueuing a new job, a default queue name must be defined or the job must have a queue set.

Due to SQS limitation, SQS Backend only support a subset of DelayedJob feature. The following feature are not supported:

  • Scheduling a job in the future
  • Enqueuing a job without a queue defined
  • Delete all job from a worker queue
  • Worker set with multiple queues
  • Job's priority
  • run_at, locked_at, locked_by and failed_at job attribute are not used and persisted
  • error hook is never called. On error, a job always calls failure, but the jub will stay in the queue.
  • max_attempts is not used. Use SQS queue settings instead.
  • destroy_failed_job is false by default since SQS works by leaving failed job in a queue.

Jobs have the following additional attributes:

  • request_id: Message request id
  • delay_seconds: Delay before the jobs is avaiable in the SQS queue
  • message: SQS ReceivedMessage object
  • queue_url: Job queue's URL. Used instead of queue if defined.

delayed_job_sqs's People

Contributors

nickhoffman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.