Skip to content

Queue Configuration

Queue configuration defines how queues are created, configured, and managed throughout their lifecycle.

StateDescription
activeQueue is accepting and delivering jobs
pausedQueue accepts new jobs but does not deliver them to workers
drainingQueue does not accept new jobs but delivers remaining jobs
deletedQueue is removed (with configurable behavior for remaining jobs)
{
"name": "payments",
"capacity": {
"max_depth": 100000,
"max_size_bytes": 104857600
},
"processing": {
"visibility_timeout": 1800,
"max_concurrency": 50
},
"retention": {
"completed_ttl": "P7D",
"failed_ttl": "P30D"
},
"dead_letter": {
"enabled": true,
"max_age": "P180D",
"max_count": 10000
},
"access": {
"producers": ["service-a", "service-b"],
"consumers": ["worker-pool-payments"]
}
}
SectionDescription
capacityMaximum queue depth and size limits
processingVisibility timeout and concurrency settings
retentionHow long completed and failed jobs are kept
dead_letterDead letter queue settings for this queue
accessAccess control lists for producers and consumers

Queues can be created in two ways:

  • Implicit: Automatically created when the first job is enqueued to a queue name that does not exist. Uses default configuration.
  • Explicit: Created via the Admin API with specific configuration before any jobs are enqueued.

Backends MUST support implicit queue creation.

Queue policies define default configuration templates:

{
"name": "high-throughput",
"config": {
"capacity": { "max_depth": 1000000 },
"processing": { "visibility_timeout": 300 }
},
"match": "batch.*"
}

Policies match queues by name pattern. When a queue is implicitly created and matches a policy, it inherits the policy’s configuration. Explicit configuration overrides policy defaults.

MethodPathDescription
POST/ojs/v1/queuesCreate a queue explicitly
GET/ojs/v1/queuesList all queues
GET/ojs/v1/queues/{name}Get queue configuration
PATCH/ojs/v1/queues/{name}Update queue configuration
DELETE/ojs/v1/queues/{name}Delete a queue
POST/ojs/v1/queues/{name}/pausePause a queue
POST/ojs/v1/queues/{name}/resumeResume a queue
POST/ojs/v1/queues/{name}/purgePurge all jobs from a queue

When a queue is deleted, remaining jobs are handled based on strategy:

StrategyBehavior
rejectReject deletion if queue has pending jobs (default)
purgeDelete queue and all remaining jobs
moveMove remaining jobs to a specified fallback queue