@boopkit/cap-background-jobs 0.3.1 → 0.4.0
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/capability.json
CHANGED
|
@@ -3,17 +3,43 @@
|
|
|
3
3
|
"description": "Background job processing with RabbitMQ via CloudAMQP",
|
|
4
4
|
"type": "application",
|
|
5
5
|
"package": "@boopkit/cap-background-jobs",
|
|
6
|
-
"requires": [
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"requires": [
|
|
7
|
+
"services"
|
|
8
|
+
],
|
|
9
|
+
"dependencies": [
|
|
10
|
+
"amqplib@^0.10",
|
|
11
|
+
"minimist@^1.2",
|
|
12
|
+
"@boopkit/logger",
|
|
13
|
+
"winston@^3"
|
|
14
|
+
],
|
|
15
|
+
"devDependencies": [
|
|
16
|
+
"@types/amqplib@^0.10",
|
|
17
|
+
"@types/minimist@^1.2"
|
|
18
|
+
],
|
|
9
19
|
"env": [
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
{
|
|
21
|
+
"name": "CLOUDAMQP_URL",
|
|
22
|
+
"description": "CloudAMQP connection URL (amqp://...)",
|
|
23
|
+
"required": "boot"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "QUEUE_PREFIX",
|
|
27
|
+
"description": "Queue name prefix for environment isolation (e.g. dev/mike)"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "MAX_MESSAGE_RETRIES",
|
|
31
|
+
"description": "Maximum retry attempts before dead-lettering (default: 5)"
|
|
32
|
+
}
|
|
13
33
|
],
|
|
14
34
|
"scripts": {
|
|
15
|
-
"worker": {
|
|
16
|
-
|
|
35
|
+
"worker": {
|
|
36
|
+
"cmd": "tsx src/worker.ts",
|
|
37
|
+
"description": "Start the background job worker process"
|
|
38
|
+
},
|
|
39
|
+
"scheduler": {
|
|
40
|
+
"cmd": "tsx src/scheduler.ts",
|
|
41
|
+
"description": "Publish trigger messages to job queues — supports --interval and --job filtering"
|
|
42
|
+
}
|
|
17
43
|
},
|
|
18
44
|
"files": [
|
|
19
45
|
"src/scheduler.ts",
|
|
@@ -22,10 +48,14 @@
|
|
|
22
48
|
"tests/controllers/example-job.controller.test.ts",
|
|
23
49
|
"reference/background-jobs.ref.md"
|
|
24
50
|
],
|
|
25
|
-
"skills": [
|
|
51
|
+
"skills": [
|
|
52
|
+
"boop-background-jobs-background-jobs-design"
|
|
53
|
+
],
|
|
26
54
|
"hooks": [],
|
|
27
55
|
"postInstall": {
|
|
28
|
-
"prerequisites": [
|
|
56
|
+
"prerequisites": [
|
|
57
|
+
"CloudAMQP addon provisioned (or CLOUDAMQP_URL set)"
|
|
58
|
+
],
|
|
29
59
|
"steps": [
|
|
30
60
|
"Add CLOUDAMQP_URL to .env",
|
|
31
61
|
"Set QUEUE_PREFIX for local dev isolation (e.g. dev/yourname)",
|
|
@@ -33,5 +63,8 @@
|
|
|
33
63
|
"Configure Heroku Scheduler to run 'npm run scheduler -- run-jobs --interval <tag>' on desired interval (e.g. 10-minutes, 60-minutes)"
|
|
34
64
|
],
|
|
35
65
|
"verify": "npm run worker"
|
|
66
|
+
},
|
|
67
|
+
"skill_migrations": {
|
|
68
|
+
"boop-background-jobs-background-jobs-design": "design.background-jobs.skill.md"
|
|
36
69
|
}
|
|
37
70
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boopkit/cap-background-jobs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Background job processing with RabbitMQ for boopkit-scaffolded projects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"build": "tsc -p tsconfig.json"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@boopkit/logger": "^0.
|
|
23
|
+
"@boopkit/logger": "^0.4.0",
|
|
24
24
|
"amqplib": "^0.10.0",
|
|
25
25
|
"minimist": "^1.2.8",
|
|
26
26
|
"winston": "^3.17.0"
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: boop-background-jobs-background-jobs-design
|
|
3
|
+
description: "When you need to add a background job consumer, publish messages, or work with the message queue infrastructure, follow these principles."
|
|
4
|
+
metadata:
|
|
5
|
+
category: design
|
|
6
|
+
---
|
|
1
7
|
# Background Jobs Design
|
|
2
|
-
When you need to add a background job consumer, publish messages, or work with the message queue infrastructure, follow these principles.
|
|
3
8
|
|
|
4
9
|
Assumes: controller design principles from [design.controllers.skill.md](../../cap-services/skills/design.controllers.skill.md) (services capability). MQ controllers follow the same thin-dispatch pattern — parse, call service, return result.
|
|
5
10
|
|