@boostkit/queue-bullmq 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +165 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 BoostKit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @boostkit/queue-bullmq
|
|
2
|
+
|
|
3
|
+
BullMQ adapter provider for `@boostkit/queue` with Redis-backed dispatch and workers.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @boostkit/queue-bullmq
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { bullmq } from '@boostkit/queue-bullmq'
|
|
15
|
+
|
|
16
|
+
const provider = bullmq({
|
|
17
|
+
host: '127.0.0.1',
|
|
18
|
+
port: 6379,
|
|
19
|
+
prefix: 'forge',
|
|
20
|
+
jobs: [],
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const adapter = provider.create()
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API Reference
|
|
27
|
+
|
|
28
|
+
- `BullMQConfig`
|
|
29
|
+
- `bullmq(config?)` → `QueueAdapterProvider`
|
|
30
|
+
|
|
31
|
+
## Configuration
|
|
32
|
+
|
|
33
|
+
- `BullMQConfig`
|
|
34
|
+
- `driver?`, `url?`
|
|
35
|
+
- `host?`, `port?`, `password?`
|
|
36
|
+
- `prefix?`
|
|
37
|
+
- `jobs?`
|
|
38
|
+
|
|
39
|
+
## Notes
|
|
40
|
+
|
|
41
|
+
- Uses `bullmq` and Redis.
|
|
42
|
+
- Register all job classes in `jobs` so worker execution can resolve by job name.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Job, QueueAdapterProvider } from '@boostkit/queue';
|
|
2
|
+
export interface BullMQConfig {
|
|
3
|
+
driver?: string;
|
|
4
|
+
/** Redis URL: redis://[:password@]host[:port][/db] */
|
|
5
|
+
url?: string;
|
|
6
|
+
/** Redis host — default: '127.0.0.1' */
|
|
7
|
+
host?: string;
|
|
8
|
+
/** Redis port — default: 6379 */
|
|
9
|
+
port?: number;
|
|
10
|
+
password?: string;
|
|
11
|
+
/** Redis key prefix — default: 'forge' */
|
|
12
|
+
prefix?: string;
|
|
13
|
+
/** Worker concurrency per queue. Default: 1 */
|
|
14
|
+
concurrency?: number;
|
|
15
|
+
/** Keep N completed jobs in Redis. Default: 100 */
|
|
16
|
+
removeOnComplete?: number;
|
|
17
|
+
/** Keep N failed jobs in Redis. Default: 500 */
|
|
18
|
+
removeOnFail?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Job classes that this worker can execute.
|
|
21
|
+
* Must match the classes dispatched with Job.dispatch().
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* jobs: [SendWelcomeEmailJob, ProcessOrderJob]
|
|
25
|
+
*/
|
|
26
|
+
jobs?: (new (...args: never[]) => Job)[];
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
export declare function bullmq(config?: BullMQConfig): QueueAdapterProvider;
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAgB,oBAAoB,EAA8C,MAAM,iBAAiB,CAAA;AAI1H,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAI,MAAM,CAAA;IACjB,sDAAsD;IACtD,GAAG,CAAC,EAAO,MAAM,CAAA;IACjB,wCAAwC;IACxC,IAAI,CAAC,EAAM,MAAM,CAAA;IACjB,iCAAiC;IACjC,IAAI,CAAC,EAAM,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,MAAM,CAAC,EAAI,MAAM,CAAA;IACjB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,CAAA;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AA8LD,wBAAgB,MAAM,CAAC,MAAM,GAAE,YAAiB,GAAG,oBAAoB,CAMtE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Queue, Worker } from 'bullmq';
|
|
2
|
+
// ─── Connection helper ─────────────────────────────────────
|
|
3
|
+
function redisOpts(config) {
|
|
4
|
+
// maxRetriesPerRequest: null is required by BullMQ for blocking commands (BRPOP etc.)
|
|
5
|
+
const base = { maxRetriesPerRequest: null, enableReadyCheck: false };
|
|
6
|
+
if (config.url) {
|
|
7
|
+
try {
|
|
8
|
+
const u = new URL(config.url.replace(/^rediss?:\/\//, 'http://'));
|
|
9
|
+
return {
|
|
10
|
+
...base,
|
|
11
|
+
host: u.hostname || '127.0.0.1',
|
|
12
|
+
port: parseInt(u.port || '6379', 10),
|
|
13
|
+
...(u.password ? { password: decodeURIComponent(u.password) } : {}),
|
|
14
|
+
...(u.pathname.length > 1 ? { db: parseInt(u.pathname.slice(1), 10) } : {}),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return { ...base, host: '127.0.0.1', port: 6379 };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
...base,
|
|
23
|
+
host: config.host ?? '127.0.0.1',
|
|
24
|
+
port: config.port ?? 6379,
|
|
25
|
+
...(config.password ? { password: config.password } : {}),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// ─── Adapter ───────────────────────────────────────────────
|
|
29
|
+
class BullMQAdapter {
|
|
30
|
+
queues = new Map();
|
|
31
|
+
jobRegistry = new Map();
|
|
32
|
+
connection;
|
|
33
|
+
prefix;
|
|
34
|
+
concurrency;
|
|
35
|
+
removeOnComplete;
|
|
36
|
+
removeOnFail;
|
|
37
|
+
constructor(config) {
|
|
38
|
+
this.connection = redisOpts(config);
|
|
39
|
+
this.prefix = config.prefix ?? 'forge';
|
|
40
|
+
this.concurrency = config.concurrency ?? 1;
|
|
41
|
+
this.removeOnComplete = config.removeOnComplete ?? 100;
|
|
42
|
+
this.removeOnFail = config.removeOnFail ?? 500;
|
|
43
|
+
for (const JobClass of (config.jobs ?? [])) {
|
|
44
|
+
this.jobRegistry.set(JobClass.name, JobClass);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
getQueue(name) {
|
|
48
|
+
if (!this.queues.has(name)) {
|
|
49
|
+
this.queues.set(name, new Queue(name, {
|
|
50
|
+
connection: this.connection,
|
|
51
|
+
prefix: this.prefix,
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
return this.queues.get(name);
|
|
55
|
+
}
|
|
56
|
+
async processor(bullJob) {
|
|
57
|
+
const JobClass = this.jobRegistry.get(bullJob.name);
|
|
58
|
+
if (!JobClass) {
|
|
59
|
+
throw new Error(`[BullMQ] Unknown job "${bullJob.name}". ` +
|
|
60
|
+
`Add it to the jobs[] array in config/queue.ts.`);
|
|
61
|
+
}
|
|
62
|
+
const instance = Object.assign(new JobClass(), bullJob.data);
|
|
63
|
+
await instance.handle();
|
|
64
|
+
}
|
|
65
|
+
async dispatch(job, options = {}) {
|
|
66
|
+
const Cls = job.constructor;
|
|
67
|
+
const queueName = options.queue ?? Cls.queue ?? 'default';
|
|
68
|
+
const delay = options.delay ?? Cls.delay ?? 0;
|
|
69
|
+
const attempts = Cls.retries ?? 3;
|
|
70
|
+
await this.getQueue(queueName).add(job.constructor.name, JSON.parse(JSON.stringify(job)), {
|
|
71
|
+
...(delay ? { delay } : {}),
|
|
72
|
+
attempts,
|
|
73
|
+
backoff: { type: 'exponential', delay: 1000 },
|
|
74
|
+
removeOnComplete: { count: this.removeOnComplete },
|
|
75
|
+
removeOnFail: { count: this.removeOnFail },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async work(queues = 'default') {
|
|
79
|
+
const names = queues.split(',').map(q => q.trim()).filter(Boolean);
|
|
80
|
+
const workers = names.map(name => new Worker(name, this.processor.bind(this), {
|
|
81
|
+
connection: this.connection,
|
|
82
|
+
prefix: this.prefix,
|
|
83
|
+
concurrency: this.concurrency,
|
|
84
|
+
}));
|
|
85
|
+
for (const worker of workers) {
|
|
86
|
+
worker.on('error', (err) => {
|
|
87
|
+
const code = err.code;
|
|
88
|
+
if (code === 'ECONNREFUSED') {
|
|
89
|
+
console.error(`[BullMQ] Cannot connect to Redis (ECONNREFUSED). ` +
|
|
90
|
+
`Make sure Redis is running on ${String(this.connection['host'] ?? '127.0.0.1')}:${String(this.connection['port'] ?? 6379)}.`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
console.error(`[BullMQ] Worker error: ${err.message}`);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
worker.on('completed', (bullJob) => {
|
|
97
|
+
console.log(`[BullMQ] ✓ "${bullJob.name}" completed (id: ${bullJob.id})`);
|
|
98
|
+
});
|
|
99
|
+
worker.on('failed', async (bullJob, error) => {
|
|
100
|
+
if (!bullJob)
|
|
101
|
+
return;
|
|
102
|
+
const JobClass = this.jobRegistry.get(bullJob.name);
|
|
103
|
+
if (JobClass) {
|
|
104
|
+
const instance = Object.assign(new JobClass(), bullJob.data);
|
|
105
|
+
await instance.failed?.(error);
|
|
106
|
+
}
|
|
107
|
+
console.error(`[BullMQ] ✗ "${bullJob.name}" failed ` +
|
|
108
|
+
`(attempt ${bullJob.attemptsMade}/${String(bullJob.opts.attempts ?? '?')}): ${error.message}`);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
console.log(`[BullMQ] Worker ready — queues: "${names.join(', ')}", concurrency: ${this.concurrency}`);
|
|
112
|
+
await new Promise((resolve) => {
|
|
113
|
+
const shutdown = () => {
|
|
114
|
+
console.log(`[BullMQ] Shutting down ${workers.length} worker(s)...`);
|
|
115
|
+
void Promise.all(workers.map(w => w.close())).then(() => resolve());
|
|
116
|
+
};
|
|
117
|
+
process.once('SIGTERM', shutdown);
|
|
118
|
+
process.once('SIGINT', shutdown);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async status(queueName = 'default') {
|
|
122
|
+
const q = this.getQueue(queueName);
|
|
123
|
+
const [waiting, active, completed, failed, delayed, paused] = await Promise.all([
|
|
124
|
+
q.getWaitingCount(),
|
|
125
|
+
q.getActiveCount(),
|
|
126
|
+
q.getCompletedCount(),
|
|
127
|
+
q.getFailedCount(),
|
|
128
|
+
q.getDelayedCount(),
|
|
129
|
+
q.getJobCountByTypes('paused'),
|
|
130
|
+
]);
|
|
131
|
+
return { waiting, active, completed, failed, delayed, paused };
|
|
132
|
+
}
|
|
133
|
+
async flush(queueName = 'default') {
|
|
134
|
+
await this.getQueue(queueName).drain();
|
|
135
|
+
}
|
|
136
|
+
async failures(queueName = 'default', limit = 50) {
|
|
137
|
+
const jobs = await this.getQueue(queueName).getFailed(0, limit - 1);
|
|
138
|
+
return jobs.map(j => ({
|
|
139
|
+
id: j.id ?? '',
|
|
140
|
+
name: j.name,
|
|
141
|
+
data: j.data,
|
|
142
|
+
error: j.failedReason ?? 'Unknown',
|
|
143
|
+
failedAt: new Date(j.timestamp),
|
|
144
|
+
attempts: j.attemptsMade,
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
async retryFailed(queueName = 'default') {
|
|
148
|
+
const jobs = await this.getQueue(queueName).getFailed(0, 1000);
|
|
149
|
+
await Promise.all(jobs.map(j => j.retry()));
|
|
150
|
+
return jobs.length;
|
|
151
|
+
}
|
|
152
|
+
async disconnect() {
|
|
153
|
+
await Promise.all([...this.queues.values()].map(q => q.close()));
|
|
154
|
+
this.queues.clear();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// ─── Factory ───────────────────────────────────────────────
|
|
158
|
+
export function bullmq(config = {}) {
|
|
159
|
+
return {
|
|
160
|
+
create() {
|
|
161
|
+
return new BullMQAdapter(config);
|
|
162
|
+
},
|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|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/boostkitjs/boostkit",
|
|
8
|
+
"directory": "packages/queue-bullmq"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"bullmq": "^5.0.0",
|
|
25
|
+
"@boostkit/queue": "0.0.1"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^20.0.0",
|
|
29
|
+
"typescript": "^5.4.0"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"dev": "tsc --watch",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"clean": "rm -rf dist"
|
|
36
|
+
}
|
|
37
|
+
}
|