BullAdapter
For the Bull queue library.
Import
Usage
Options
All options are optional.
Tip
allowCompletedRetries (available on BullMQAdapter) has no effect here. Bull can't retry completed jobs, so it's always off.
For the Bull queue library.
import { BullAdapter } from '@bull-board/api/bullAdapter';
// or
const { BullAdapter } = require('@bull-board/api/bullAdapter');import { createBullBoard } from '@bull-board/api';
import { BullAdapter } from '@bull-board/api/bullAdapter';
import { ExpressAdapter } from '@bull-board/express';
import Queue from 'bull';
const myQueue = new Queue('my-queue', {
redis: { host: 'localhost', port: 6379 },
});
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/admin/queues');
createBullBoard({
queues: [new BullAdapter(myQueue)],
serverAdapter,
});All options are optional.
| Option | Type | Default | Description |
|---|---|---|---|
readOnlyMode | boolean | false | Hides all queue and job actions. |
allowRetries | boolean | true | Shows or hides the retry buttons on failed jobs. Forced to false when readOnlyMode is true. |
description | string | '' | Queue description text displayed in the UI. |
displayName | string | '' | Overrides the queue name shown in the UI. |
prefix | string | '' | Prepended to job names in the UI. |
delimiter | string | '' | Delimiter between the prefix and the job name. |
externalJobUrl | (job) => { href, displayText? } | none | Links each job card to a page in your own app. See External job URLs. |
jobDataSchema | object (JSON Schema) | none | Describes the shape of a job's data, driving the Add job form's prefill, autocomplete and inline validation. See Job data schema. |
allowCompletedRetries (available on BullMQAdapter) has no effect here. Bull can't retry completed jobs, so it's always off.
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';
});