@nwire/queue-bullmq
v0.7.1
Published
Nwire — BullMQ-backed QueueTransport for production. Redis-backed durable queues + delayed jobs (timer scheduler) + failed-jobs board.
Readme
@nwire/queue-bullmq
BullMQ-backed
QueueTransport— Redis-durable background jobs.
What it does
Implements the @nwire/queue QueueTransport over BullMQ. One BullMQ Queue per queue name; one Worker per subscribe(). enqueue with delayMs translates to BullMQ's delay option; messageId becomes BullMQ's jobId for idempotency. Failed jobs flow into BullMQ's failed-jobs board after the runtime's retry+DLQ logic exhausts.
Install
pnpm add @nwire/queue-bullmq @nwire/queue bullmqQuick start
import { BullMQQueueTransport } from "@nwire/queue-bullmq";
import { createQueueWorker } from "@nwire/queue";
import { app } from "./app";
const transport = new BullMQQueueTransport({
connection: { host: "localhost", port: 6379 },
prefix: "learnflow",
defaultConcurrency: 5,
});
const worker = createQueueWorker(app, transport, {
subscribe: [
{ queue: "emails", action: "sendWelcomeEmail" },
{ queue: "reports", action: "generateMonthlyReport", retry: { attempts: 3 } },
],
});
await worker.start();API surface
BullMQQueueTransport({ connection, prefix?, defaultConcurrency? })— implementsQueueTransport.
When to use
Any production queue workload — same handler shape as InMemoryQueueTransport, swapped by config.
Within nwire-app
For developers using this package as part of the Nwire stack — register it via app.use(...) or it auto-wires when you compose createApp({ modules }).
import { createApp } from "@nwire/forge";
const app = createApp({
/* ...config... */
});
// Adapter/plugin wiring happens here when applicable.