Skip to content

Job Format

Mike Perham edited this page Jul 29, 2013 · 15 revisions

Sidekiq serializes jobs to Redis in JSON format.

Job

At bare minimum, a job requires three fields:

{ 'class': 'SomeWorker', 'jid': <12-byte random number as 24 char hex string>, 'args': [1, 'arg', true], }

args is splatted onto the worker class's perform method.

Retries

Sidekiq's retry feature adds several elements to the job payload:

  • 'queue' - the queue to use when retrying
  • 'retry_count' - number of times we've retried so far
  • 'error_message' - the exception message
  • 'error_class' - the exception class
  • 'error_backtrace' - some or all of the exception's backtrace, optional
  • 'failed_at' - the first time the job failed
  • 'retried_at' - the last time the job failed