Integrations

Bull Integration

Connect Queuedash to your Bull queues.

Bull is a popular Redis-based queue. The SDK needs Bull 4 or later, recognizes a Bull queue when you attach it, and listens to its events.

Attach a queue

import Queue from "bull";
import { Queuedash } from "@queuedash/sdk";
 
const qd = new Queuedash({
  apiKey: process.env.QUEUEDASH_API_KEY,
});
 
// Initialize your queue and attach it
const myQueue = new Queue("my-queue", "redis://localhost:6379");
 
qd.attach(myQueue);

Bull emits active and progress only in the process that runs the job, so attach the queue in your worker process.

Multiple queues

import Queue from "bull";
import { Queuedash } from "@queuedash/sdk";
 
const redisUrl = "redis://localhost:6379";
 
const qd = new Queuedash({
  apiKey: process.env.QUEUEDASH_API_KEY,
});
 
qd.attach(new Queue("emails", redisUrl));
qd.attach(new Queue("reports", redisUrl));
qd.attach(new Queue("notifications", redisUrl));

Tracked events

  • active, progress
  • removed
  • global:completed, global:failed: Bull passes only a job ID to these, so the SDK loads the job by ID (SDK 2.0.1 and later)

Migrating to BullMQ

Queuedash matches jobs to a queue by name within the environment, not by library. Attach the BullMQ queue under the same name and its jobs go to the same Queuedash queue. Jobs are stored by job ID, so if the new queue starts its IDs over, a new job replaces the stored job with the same ID.