BullMQ Proxy
  • What is BullMQ Proxy
  • Getting started
    • Architecture overview
    • Using Dragonfly
  • HTTP API
    • Authentication
    • Queues
      • Adding jobs
        • Retries
        • Delayed jobs
        • Prioritized
        • Repeatable
        • LIFO
        • Custom Job IDs
      • Getting jobs
      • Queue's actions
      • Reference
    • Workers
      • Endpoints
      • Adding workers
        • Concurrency
        • Rate-Limit
        • Removing finished jobs
        • Stalled jobs
        • Timeouts
      • Removing workers
      • Getting workers
      • Reference
    • Jobs
      • Jobs' actions
        • Update job progress
        • Add job logs
      • Reference
    • Configuration
    • Debugging
Powered by GitBook
On this page
  • Workers API
  • Add / Update a worker
  • Remove worker
  • Get workers
  1. HTTP API
  2. Workers

Reference

Workers API Reference

interface WorkerMetadata {
  queue: string;
  endpoint: EndpointOptions;
  opts?: WorkerOptions;
}
interface EndpointOptions {
    url: string;
    method: "post" | "get" | "put" | "delete" | "patch";
    headers?: Record<string, string>;
    timeout?: number; // max allowed duration in milliseconds
}
interface WorkerOptions {
  concurrency?: number;
  limiter?: {
    max: number; // integer representing max number of jobs to process on "duration"
    duration: number: // number of millisecons
  };
  removeOnComplete?: {
    count?: number;
    age?: number;
  };
  removeOnFail?: {
    count?: number;
    age?: number;
  };
  maxStalledCount?: number;
}

Workers API

Add / Update a worker

POST /workers

Adds a new worker or updates an existing one.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

queue

string

Name of the queue

endpoint

Endpoint

Endpoint options

opts

WorkerOptions

Options for the worker

Response

"OK"
Error message depending on the cause of the error

Remove worker

DELETE /workers/:queue-name

Removes an existing worker for a given queue.

Headers

Name
Value

Authorization

Bearer <token>

Response

"OK"
"Worker not found"

Get workers

GET /workers

Gets all the workers registered in the proxy.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

{
  "queue-name": "url"
}
PreviousGetting workersNextJobs

Last updated 1 year ago