Getting started
Expose your first BullMQ queue to Queuebert without replacing your workers.
Install the NestJS integration#
Use Node.js 24 with an existing NestJS 11 application and a reachable Redis instance. Keep your application's usual reflect-metadata and rxjs setup.
npm install @queuebert/nest @nestjs/bullmq@^11 @nestjs/common@^11 @nestjs/core@^11 bullmq@^5Already using BullModule.forRoot() and BullModule.registerQueue()? Keep those registrations and add only the Queuebert module. Do not create a second set of workers just for monitoring.
Register a queue#
This monitoring-only example uses a queue named emails. It deliberately omits a processor: queue counts work without one, while processor duration and throughput require instrumentation.
AdminGuard below is your application's authentication and authorization guard. Import your existing guard, or adapt the bearer-token example before exposing this API.
import { Module } from '@nestjs/common';
import { BullModule } from '@nestjs/bullmq';
import { QueuebertModule } from '@queuebert/nest';
import { AdminGuard } from './admin.guard';
@Module({
imports: [
BullModule.forRoot({
connection: { host: '127.0.0.1', port: 6379 },
}),
BullModule.registerQueue({ name: 'emails' }),
QueuebertModule.forRoot({
path: 'admin/queue',
queues: [{ name: 'emails' }],
auth: { guards: [AdminGuard] },
endpoints: ['metrics'],
}),
],
})
export class AppModule {}Verify the endpoint#
Start your Nest application. If you use the bearer guard from the security guide, supply its token in the Authorization header:
curl --fail \
-H "Authorization: Bearer $QUEUEBERT_TOKEN" \
http://localhost:3000/admin/queue/statsThe response includes queue statistics, capability information, and Redis statistics unless disabled. An idle queue can legitimately have zero counts. Without an instrumented processor, duration and worker throughput will not be available.
If the app calls app.setGlobalPrefix('api'), the URL is /api/admin/queue/stats. Account for reverse-proxy prefixes too. Use a URL reachable from the device running Queuebert; localhost on a physical phone refers to the phone, not your development machine.
Connect a client#
Configure your Queuebert client with your service's Queuebert endpoint and the credentials accepted by your guard. Keep the API behind HTTPS outside local development. A web client on another origin also needs your service's CORS policy to allow that origin and the authorization header.
Read authentication and safety before enabling writes. Then add processor statistics or consult the HTTP API reference.