BullMQAdapter

For the BullMQ queue library.

Import

import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
// or
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');

Usage

import { createBullBoard } from '@bull-board/api';
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
import { ExpressAdapter } from '@bull-board/express';
import { Queue } from 'bullmq';

const myQueue = new Queue('my-queue', {
  connection: { host: 'localhost', port: 6379 },
});

const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/admin/queues');

createBullBoard({
  queues: [new BullMQAdapter(myQueue)],
  serverAdapter,
});

Options

All options are optional.

OptionTypeDefaultDescription
readOnlyModebooleanfalseHides all queue and job actions.
allowRetriesbooleantrueShows or hides the retry buttons on failed jobs. Forced to false when readOnlyMode is true.
allowCompletedRetriesbooleantrueShows or hides the retry button on completed jobs. Only takes effect when allowRetries is true.
descriptionstring''Queue description text displayed in the UI.
displayNamestring''Overrides the queue name shown in the UI.
prefixstring''Prepended to job names in the UI.
delimiterstring''Delimiter between the prefix and the job name.
externalJobUrl(job) => { href, displayText? }noneLinks each job card to a page in your own app. See External job URLs.

Instance methods

adapter.setFormatter('name', (job) => `#${job.name}`);
adapter.setFormatter('data', (data) => redact(data));
adapter.setFormatter('returnValue', (value) => redact(value));
adapter.setFormatter('progress', (progress) => `${Math.round(progress)}%`);

adapter.setVisibilityGuard((request) => {
  // return true to show this queue, false to hide it
  return request.headers['x-tenant-id'] === 'acme';
});

Flow tree

The flow tree tab on the job detail page works with BullMQAdapter queues automatically. There's nothing to configure. When you open a job that belongs to a BullMQ flow, bull-board reads the parent/child graph and renders it.

It builds a FlowProducer from the Redis connection of a registered BullMQAdapter (cached per connection), then walks the job's parent chain across queues to find the flow root. So it works as long as every queue in the flow is registered on the board.

Tip

The flow tree only spans queues bull-board knows about. If a parent job lives in a queue you didn't pass to createBullBoard, the tree stops at the boundary. Register every queue that participates in the flow.

Bull (the legacy library) has no flows, so the tab is BullMQ-only.