Background Jobs
How to organize background jobs with logical queues
Use named SendMQ queues to label receipts, exports, and other HTTP work consistently across your application.
By SendMQ 1 min read
What is a logical queue in SendMQ?
A logical queue is a named grouping for jobs in a workspace. Use names that match work your team recognizes, such as receipts or exports. Leave queue unset to use the default queue.
Group by workload or ownership. If the checkout and reporting teams share a workspace, naming their queues gives each team a consistent place to start when a customer reports a missing receipt or export.
How do you put a job on a named queue?
Create the queue with POST /v1/queues, then pass its name in the queue field of POST /v1/jobs. Keep the name in the application configuration for the producer that owns the workflow. For a repeated submission, reuse the same queue and effective request with the original idempotency key.
{
"queue": "exports",
"url": "https://api.example.com/tasks/export-report",
"method": "POST",
"body": {"report_id": "report-42"}
}How can queues help with incident triage?
Log the queue name and job ID with the record that created the work. If a customer asks about report-42, look up its job ID in your application and open that job in SendMQ to inspect its attempt history. The queue name identifies the kind of work and helps your team group its own application logs during an incident.
Before switching to a new queue name, update the configuration for new submissions. Keep the original queue value in any persisted requests you plan to resubmit with the same idempotency key. Changing the queue on a previously accepted request can create an idempotency conflict.