-
Notifications
You must be signed in to change notification settings - Fork 229
The Job Payload
Mike Perham edited this page Oct 18, 2017
·
16 revisions
A Faktory job is a JSON hash with a few mandatory elements. The bare minimum:
{
"jid": "123861239abnadsa",
"jobtype": "SomeName",
"args": [1, 2, "hello"],
}
The worker uses jobtype
to determine how to execute this job, the args provide necessary state for the job to run. JID is a unique ID for each job.
You can customize Faktory's behavior by setting additional elements in the JSON hash:
-
"queue": "default"
- push this job to a particular queue. The default queue is "default". -
"reserve_for": 600
- set the reservation timeout for a job, in seconds. After this time, the job will be requeued for execution by another worker. Default is 1800 seconds or 30 minutes, minimum is 60 seconds. -
"at": "2017-12-20T15:30:17.111222333Z"
- schedule a job to run at a point in time. The job will be enqueued within a few seconds of that point in time. Note the string must be in Go's RFC3339Nano time format. -
"retry": 3
- set the number of retries to perform if this job fails. Default is 25 (which, with exponential backoff, means Faktory will retry the job over a 21 day period). A value of 0 means the job will not be retried and will be discarded if it fails. A value of -1 means don't retry but move the job immediately to the Dead set if it fails. -
"backtrace": 10
- retain up to N lines of backtrace given to the FAIL command.
Home | Installation | Getting Started Ruby | Job Errors | FAQ | Related Projects
This wiki is tracked by git and publicly editable. You are welcome to fix errors and typos. Any defacing or vandalism of content will result in your changes being reverted and you being blocked.