@pauldeng/node-red-contrib-bullmq 1.0.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/LICENSE +22 -0
- package/README.md +124 -0
- package/bull-queue.html +530 -0
- package/bull-queue.js +523 -0
- package/docs/ARCHITECTURE.md +52 -0
- package/docs/CHANGE_WORKFLOW.md +27 -0
- package/docs/COMMANDS.md +89 -0
- package/docs/CONNECTIONS.md +54 -0
- package/docs/MIGRATION.md +37 -0
- package/docs/NODE_GUIDE.md +83 -0
- package/docs/REFERENCE_MAP.md +51 -0
- package/docs/RELEASE.md +108 -0
- package/docs/TESTING.md +88 -0
- package/docs/TROUBLESHOOTING.md +28 -0
- package/examples/README.md +35 -0
- package/examples/bullmq_features.json +331 -0
- package/examples/example_flow.json +277 -0
- package/examples/repeatable_jobs.json +245 -0
- package/icons/bull_icon.png +0 -0
- package/lib/acknowledgements.js +110 -0
- package/lib/commands.js +230 -0
- package/lib/connections.js +300 -0
- package/lib/scheduler.js +114 -0
- package/lib/serialization.js +63 -0
- package/package.json +70 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Connection Guide
|
|
2
|
+
|
|
3
|
+
## Standalone Redis
|
|
4
|
+
|
|
5
|
+
Use deployment `single`, host, port, optional database, optional username/password, and optional TLS.
|
|
6
|
+
|
|
7
|
+
Producer commands use bounded retries so Node-RED input handlers fail instead of hanging forever. Workers and QueueEvents use persistent retry behavior required by BullMQ.
|
|
8
|
+
|
|
9
|
+
## Redis Cluster
|
|
10
|
+
|
|
11
|
+
Use deployment `cluster` and provide startup nodes as comma or newline separated `host:port` values.
|
|
12
|
+
|
|
13
|
+
Cluster auth and TLS are applied through ioredis `redisOptions`. The runtime sets a DNS lookup passthrough for TLS-enabled cluster discovery.
|
|
14
|
+
|
|
15
|
+
Use a BullMQ prefix with a hash tag, normally `{bull}`.
|
|
16
|
+
|
|
17
|
+
## AWS MemoryDB
|
|
18
|
+
|
|
19
|
+
Use deployment `cluster`.
|
|
20
|
+
|
|
21
|
+
Typical settings:
|
|
22
|
+
|
|
23
|
+
- cluster endpoint and port as a startup node;
|
|
24
|
+
- ACL username and password;
|
|
25
|
+
- TLS enabled;
|
|
26
|
+
- prefix `{bull}`;
|
|
27
|
+
- client located in a VPC/network path that can reach MemoryDB.
|
|
28
|
+
|
|
29
|
+
Do not write MemoryDB credentials into flows, examples, docs, or logs.
|
|
30
|
+
|
|
31
|
+
## Sentinel
|
|
32
|
+
|
|
33
|
+
Use deployment `sentinel` and configure:
|
|
34
|
+
|
|
35
|
+
- Sentinel endpoints;
|
|
36
|
+
- master name;
|
|
37
|
+
- optional Redis data-node username/password;
|
|
38
|
+
- optional Sentinel username/password;
|
|
39
|
+
- optional TLS for Redis data nodes;
|
|
40
|
+
- optional TLS for Sentinel discovery.
|
|
41
|
+
|
|
42
|
+
Sentinel authentication is separate from Redis data-node authentication.
|
|
43
|
+
|
|
44
|
+
## TLS
|
|
45
|
+
|
|
46
|
+
TLS options:
|
|
47
|
+
|
|
48
|
+
- verify unauthorized certificates by default;
|
|
49
|
+
- optional CA;
|
|
50
|
+
- optional client certificate;
|
|
51
|
+
- optional client private key;
|
|
52
|
+
- optional server name.
|
|
53
|
+
|
|
54
|
+
Disable verification only when the Redis deployment cannot be configured with a trusted CA and the risk is understood.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Migration From Bull v4
|
|
2
|
+
|
|
3
|
+
## What Stays Compatible
|
|
4
|
+
|
|
5
|
+
- Node types `bull-queue-server`, `bull cmd`, and `bull run`.
|
|
6
|
+
- Message-driven `msg.cmd` command dispatch.
|
|
7
|
+
- `msg.payload` compatibility for added jobs and worker output.
|
|
8
|
+
- `msg.jobopts.repeat.cron` for scheduled jobs.
|
|
9
|
+
|
|
10
|
+
## What Changes
|
|
11
|
+
|
|
12
|
+
- Runtime dependency is BullMQ 5.78.0.
|
|
13
|
+
- `bull` and `sprintf-js` are removed.
|
|
14
|
+
- Repeatable jobs use BullMQ Job Schedulers.
|
|
15
|
+
- Scheduled jobs require a stable scheduler id.
|
|
16
|
+
- `bull run` uses BullMQ Worker instead of Bull v4 `queue.process`.
|
|
17
|
+
|
|
18
|
+
## Repeat Jobs
|
|
19
|
+
|
|
20
|
+
Legacy:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
msg.jobopts = {
|
|
24
|
+
jobId: msg.payload,
|
|
25
|
+
repeat: { cron: "30 9,19,29,39,49,59 * * * *" },
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Runtime translation:
|
|
30
|
+
|
|
31
|
+
- scheduler id: `msg.schedulerId` or `msg.jobopts.jobId`;
|
|
32
|
+
- repeat pattern: `msg.jobopts.repeat.pattern`;
|
|
33
|
+
- template data: `msg.jobData` or `{ payload: msg.payload }`.
|
|
34
|
+
|
|
35
|
+
## Data Migration
|
|
36
|
+
|
|
37
|
+
Bull v4 and BullMQ do not provide a supported Redis data migration contract. Do not assume existing delayed, waiting, active, completed, or repeatable Bull v4 keys will be usable by BullMQ.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Node Guide
|
|
2
|
+
|
|
3
|
+
## `bull-queue-server`
|
|
4
|
+
|
|
5
|
+
Configures queue name, Redis deployment, credentials, TLS, and BullMQ prefix.
|
|
6
|
+
|
|
7
|
+
Deployment modes:
|
|
8
|
+
|
|
9
|
+
- `single`: standalone Redis.
|
|
10
|
+
- `cluster`: Redis Cluster and AWS MemoryDB.
|
|
11
|
+
- `sentinel`: Redis Sentinel.
|
|
12
|
+
|
|
13
|
+
Use `{bull}` for Cluster and MemoryDB unless you have a tested prefix strategy.
|
|
14
|
+
|
|
15
|
+
## `bull cmd`
|
|
16
|
+
|
|
17
|
+
Input node for producer and administration commands.
|
|
18
|
+
|
|
19
|
+
Input:
|
|
20
|
+
|
|
21
|
+
- `msg.cmd`: command name. Defaults to `add`.
|
|
22
|
+
- `msg.payload`: compatibility payload.
|
|
23
|
+
- `msg.jobData`: full BullMQ job data when supplied.
|
|
24
|
+
- `msg.jobName`: BullMQ job name. Defaults to `default`.
|
|
25
|
+
- `msg.jobopts`: BullMQ job options.
|
|
26
|
+
|
|
27
|
+
Output:
|
|
28
|
+
|
|
29
|
+
- successful result in `msg.payload`;
|
|
30
|
+
- errors go to `done(err)` or `node.error(err, msg)`.
|
|
31
|
+
|
|
32
|
+
## `bull run`
|
|
33
|
+
|
|
34
|
+
Worker node with no input and one output.
|
|
35
|
+
|
|
36
|
+
Output message:
|
|
37
|
+
|
|
38
|
+
- `msg.payload`: `job.data.payload` when present, otherwise full `job.data`;
|
|
39
|
+
- `msg.job`: serialized job metadata;
|
|
40
|
+
- `msg.bull`: queue and job context.
|
|
41
|
+
|
|
42
|
+
Completion modes:
|
|
43
|
+
|
|
44
|
+
- `immediate`: complete after sending the message.
|
|
45
|
+
- `manual`: wait for downstream `bull job` acknowledgement. Fails the job after the ack timeout; set the timeout to `0` to wait indefinitely.
|
|
46
|
+
|
|
47
|
+
## `bull job`
|
|
48
|
+
|
|
49
|
+
Acts on manual-mode active jobs. Actions can be configured or supplied in `msg.cmd`.
|
|
50
|
+
|
|
51
|
+
Terminal actions:
|
|
52
|
+
|
|
53
|
+
- `complete`
|
|
54
|
+
- `fail`
|
|
55
|
+
- `failUnrecoverable`
|
|
56
|
+
- `rateLimit`
|
|
57
|
+
|
|
58
|
+
Non-terminal actions:
|
|
59
|
+
|
|
60
|
+
- `progress`
|
|
61
|
+
- `removeDeduplicationKey`
|
|
62
|
+
- `getChildrenValues`
|
|
63
|
+
- `getFailedChildrenValues`
|
|
64
|
+
- `removeUnprocessedChildren`
|
|
65
|
+
|
|
66
|
+
## `bull events`
|
|
67
|
+
|
|
68
|
+
QueueEvents source node. Empty event filter subscribes to the default documented event list.
|
|
69
|
+
|
|
70
|
+
Output:
|
|
71
|
+
|
|
72
|
+
- `msg.topic`: event name;
|
|
73
|
+
- `msg.payload`: BullMQ event payload;
|
|
74
|
+
- `msg.bull`: queue, event, and event id metadata.
|
|
75
|
+
|
|
76
|
+
## `bull flow`
|
|
77
|
+
|
|
78
|
+
Adds a BullMQ FlowProducer tree.
|
|
79
|
+
|
|
80
|
+
Input:
|
|
81
|
+
|
|
82
|
+
- `msg.payload`: BullMQ flow tree;
|
|
83
|
+
- `msg.flowopts`: optional FlowProducer options.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Reference Map
|
|
2
|
+
|
|
3
|
+
## Runtime
|
|
4
|
+
|
|
5
|
+
- `bull-queue.js`: Node-RED registration and runtime glue.
|
|
6
|
+
- `lib/connections.js`: Redis deployment normalization and ioredis descriptors.
|
|
7
|
+
- `lib/scheduler.js`: legacy repeat-cron to BullMQ Job Scheduler normalization.
|
|
8
|
+
- `lib/commands.js`: `bull cmd` dispatch.
|
|
9
|
+
- `lib/serialization.js`: message-safe BullMQ serialization.
|
|
10
|
+
- `lib/acknowledgements.js`: manual-acknowledgement registry for `bull run`/`bull job`. Entries self-remove on settle.
|
|
11
|
+
|
|
12
|
+
## Editor
|
|
13
|
+
|
|
14
|
+
- `bull-queue.html`: Node-RED edit dialogs and help text.
|
|
15
|
+
- `icons/bull_icon.png`: palette icon.
|
|
16
|
+
|
|
17
|
+
## Tests
|
|
18
|
+
|
|
19
|
+
- `test/package-contract.test.js`: dependency and runtime import contract.
|
|
20
|
+
- `test/connections.test.js`: Redis topology option normalization.
|
|
21
|
+
- `test/scheduler.test.js`: repeat scheduler compatibility.
|
|
22
|
+
- `test/commands.test.js`: command dispatch behavior.
|
|
23
|
+
- `test/acknowledgements.test.js`: manual-acknowledgement registry lifecycle and leak prevention.
|
|
24
|
+
- `test/node-red-registration.test.js`: Node-RED node type registration.
|
|
25
|
+
- `test/editor-contract.test.js`: static editor surface.
|
|
26
|
+
- `test/docs-contract.test.js`: required docs and examples.
|
|
27
|
+
- `test/docker-matrix-contract.test.js`: Docker deployment fixture and runner contract.
|
|
28
|
+
- `test/integration-standalone.test.js`: opt-in local Redis Node-RED runtime flow tests for add/run, manual acknowledgement, repeat schedulers, delayed jobs, priorities, rate limits, deduplication events, and flow producer jobs.
|
|
29
|
+
- `test/integration-deployment.test.js`: opt-in external Redis deployment flow test used by Docker and MemoryDB.
|
|
30
|
+
|
|
31
|
+
## Deployment Test Fixtures
|
|
32
|
+
|
|
33
|
+
- `scripts/run-deployment-tests.js`: Docker and optional MemoryDB deployment runner.
|
|
34
|
+
- `test/deployments/single-noauth/`: standalone Redis without auth.
|
|
35
|
+
- `test/deployments/single-auth/`: standalone Redis with ACL auth.
|
|
36
|
+
- `test/deployments/single-tls/`: standalone Redis with TLS.
|
|
37
|
+
- `test/deployments/cluster-auth/`: Redis Cluster with ACL auth.
|
|
38
|
+
- `test/deployments/cluster-tls/`: Redis Cluster with TLS.
|
|
39
|
+
- `test/deployments/sentinel-auth/`: Redis Sentinel with data-node ACL auth.
|
|
40
|
+
- `test/deployments/sentinel-tls/`: Redis Sentinel with TLS for data-node and Sentinel connections.
|
|
41
|
+
- `test/deployments/tls-certs/`: local self-signed certificates for Docker TLS fixtures.
|
|
42
|
+
|
|
43
|
+
## User Docs
|
|
44
|
+
|
|
45
|
+
- `README.md`: overview and installation.
|
|
46
|
+
- `docs/NODE_GUIDE.md`: node behavior.
|
|
47
|
+
- `docs/COMMANDS.md`: command reference.
|
|
48
|
+
- `docs/CONNECTIONS.md`: Redis deployments.
|
|
49
|
+
- `docs/MIGRATION.md`: Bull v4 migration.
|
|
50
|
+
- `docs/TESTING.md`: verification plan.
|
|
51
|
+
- `docs/TROUBLESHOOTING.md`: operational issues.
|
package/docs/RELEASE.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Release Guide
|
|
2
|
+
|
|
3
|
+
Checklist for publishing `@pauldeng/node-red-contrib-bullmq` to npm and the
|
|
4
|
+
Node-RED Flow Library, following current (2025-2026) supply-chain practice.
|
|
5
|
+
|
|
6
|
+
Publishing uses **npm trusted publishing (OIDC)** from GitHub Actions. There is
|
|
7
|
+
no long-lived `NPM_TOKEN`: the release workflow mints a short-lived OIDC
|
|
8
|
+
credential per run and attaches build provenance automatically. (Classic npm
|
|
9
|
+
tokens were revoked in December 2025; only granular tokens remain, and they are
|
|
10
|
+
used here only for the one-time first publish.)
|
|
11
|
+
|
|
12
|
+
## 1. Preflight
|
|
13
|
+
|
|
14
|
+
1. Confirm `package.json` has the intended `version` and the name `@pauldeng/node-red-contrib-bullmq`.
|
|
15
|
+
2. Confirm the GitHub repository is `https://github.com/pauldeng/node-red-contrib-bullmq`.
|
|
16
|
+
3. Confirm BullMQ is pinned to exactly `5.78.0`.
|
|
17
|
+
4. Confirm no examples, docs, fixtures, or logs contain Redis, Sentinel, or MemoryDB secrets.
|
|
18
|
+
5. Update `CHANGELOG.md` for the new version.
|
|
19
|
+
|
|
20
|
+
## 2. Local verification
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm ci
|
|
24
|
+
npm test # unit + contract tests
|
|
25
|
+
npm run test:playwright # editor tests
|
|
26
|
+
npm run format:check # prettier gate
|
|
27
|
+
npm run validate # Node-RED scorecard preflight (node-red-dev)
|
|
28
|
+
npm audit --omit=dev --audit-level=moderate
|
|
29
|
+
npm pack --dry-run # confirm the tarball is clean
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For deployment changes, also run:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm run test:deployments
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
MemoryDB verification is opt-in and environment-only:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
MEMORYDB_ENABLED=1 npm run test:deployments
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 3. One-time account and repository setup
|
|
45
|
+
|
|
46
|
+
Do these once, before the first release.
|
|
47
|
+
|
|
48
|
+
### npm account
|
|
49
|
+
|
|
50
|
+
- [ ] Enable 2FA for authorization and writes: `npm profile enable-2fa auth-and-writes`.
|
|
51
|
+
- [ ] Make sure the `@pauldeng` scope exists and you can publish under it.
|
|
52
|
+
- [ ] Create a short-lived **granular** access token (write scope, this package only) for the one-time first publish in step 4.
|
|
53
|
+
|
|
54
|
+
### GitHub repository settings
|
|
55
|
+
|
|
56
|
+
- [ ] **Branch ruleset** on `master` (Settings -> Rules -> Rulesets): require a pull request with at least one review, require the CI status checks to pass, block force pushes, restrict deletions. Optionally require linear history and signed commits.
|
|
57
|
+
- [ ] **Code security and analysis** (Settings): enable Dependabot alerts, Dependabot security updates, secret scanning, push protection, and private vulnerability reporting.
|
|
58
|
+
- [ ] **Workflow permissions** (Settings -> Actions -> General): set the default `GITHUB_TOKEN` to read-only.
|
|
59
|
+
- [ ] **CodeQL**: either rely on `.github/workflows/codeql.yml`, or enable Code scanning "default setup" in the Security tab.
|
|
60
|
+
- [ ] **`release` environment** (Settings -> Environments -> New environment -> `release`): add yourself as a required reviewer so `publish.yml` waits for manual approval.
|
|
61
|
+
|
|
62
|
+
## 4. First publish (one time, manual)
|
|
63
|
+
|
|
64
|
+
Trusted publishing can only be configured on a package that already exists, so
|
|
65
|
+
publish v1.0.0 manually first.
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm publish --access public # authenticated with the granular token + 2FA
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
After publishing, inspect the npm package page and verify the README, badges,
|
|
72
|
+
license, repository link, and tarball contents.
|
|
73
|
+
|
|
74
|
+
## 5. Configure trusted publishing
|
|
75
|
+
|
|
76
|
+
On npmjs.com -> the package -> Settings -> Trusted Publisher:
|
|
77
|
+
|
|
78
|
+
- [ ] Add a GitHub Actions publisher: owner `pauldeng`, repository `node-red-contrib-bullmq`, workflow filename `publish.yml` (case-sensitive), optional environment `release`.
|
|
79
|
+
- [ ] Set the package to "Require two-factor authentication and disallow tokens".
|
|
80
|
+
- [ ] Revoke the temporary granular token from step 3.
|
|
81
|
+
|
|
82
|
+
## 6. Subsequent releases (automated)
|
|
83
|
+
|
|
84
|
+
For every release after the first:
|
|
85
|
+
|
|
86
|
+
1. Bump the version and tag it (a signed tag is recommended):
|
|
87
|
+
```sh
|
|
88
|
+
npm version <patch|minor|major>
|
|
89
|
+
git push --follow-tags
|
|
90
|
+
```
|
|
91
|
+
2. Create a **GitHub Release** for the new tag. Publishing the `release` triggers `.github/workflows/publish.yml`.
|
|
92
|
+
3. Approve the `release` environment deployment when prompted.
|
|
93
|
+
4. The workflow publishes to npm over OIDC with provenance - no token needed.
|
|
94
|
+
|
|
95
|
+
Confirm `npm view @pauldeng/node-red-contrib-bullmq` shows the new version and
|
|
96
|
+
that the npm page displays the green provenance badge.
|
|
97
|
+
|
|
98
|
+
## 7. Node-RED Flow Library
|
|
99
|
+
|
|
100
|
+
The Flow Library indexes npm but submission is **manual** (since April 2020).
|
|
101
|
+
Scoped packages are fully supported and listed.
|
|
102
|
+
|
|
103
|
+
- [ ] First time: submit via the `+` button at <https://flows.nodered.org/add/node> using package `@pauldeng/node-red-contrib-bullmq`.
|
|
104
|
+
- [ ] For later versions: use the "request refresh" link on the package's library page (visible when logged in).
|
|
105
|
+
|
|
106
|
+
## 8. Optional
|
|
107
|
+
|
|
108
|
+
- [ ] Self-certify the OpenSSF Best Practices badge at <https://www.bestpractices.dev>.
|
package/docs/TESTING.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Testing
|
|
2
|
+
|
|
3
|
+
## Fast Local Tests
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm test
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This runs built-in `node:test` suites for package metadata, connection normalization, scheduler compatibility, command dispatch, editor surface, registration, Docker fixture contracts, docs, and examples.
|
|
10
|
+
|
|
11
|
+
## Node-RED Runtime Tests
|
|
12
|
+
|
|
13
|
+
Use `node-red-node-test-helper` for flow-level tests. Runtime coverage should load actual Node-RED flows for:
|
|
14
|
+
|
|
15
|
+
- `bull cmd` success and failure paths;
|
|
16
|
+
- `bull run` immediate and manual modes;
|
|
17
|
+
- `bull job` acknowledgement actions;
|
|
18
|
+
- `bull events`;
|
|
19
|
+
- `bull flow`;
|
|
20
|
+
- legacy flow compatibility.
|
|
21
|
+
|
|
22
|
+
The current standalone Redis integration suite is opt-in:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm run test:integration
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
It starts a temporary local `redis-server`, loads real Node-RED flows, and verifies:
|
|
29
|
+
|
|
30
|
+
- `bull cmd` add/run behavior;
|
|
31
|
+
- manual `bull run` acknowledgement through `bull job`;
|
|
32
|
+
- legacy repeat scheduler creation, lookup, and removal;
|
|
33
|
+
- delayed-job commands;
|
|
34
|
+
- priority listing and counts;
|
|
35
|
+
- global rate-limit commands;
|
|
36
|
+
- deduplication commands and `bull events` delivery;
|
|
37
|
+
- `bull flow` parent/child FlowProducer output.
|
|
38
|
+
|
|
39
|
+
## Playwright
|
|
40
|
+
|
|
41
|
+
Editor changes require Playwright coverage:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npm run test:playwright
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Cover deployment field visibility, credential persistence, TLS fields, and edit dialogs for all node types.
|
|
48
|
+
|
|
49
|
+
## Docker Matrix
|
|
50
|
+
|
|
51
|
+
Use Docker for the topology matrix:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
npm run test:deployments
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The runner starts each fixture, waits for Redis readiness, runs `test/integration-deployment.test.js`, and removes volumes between deployments.
|
|
58
|
+
|
|
59
|
+
Current executable fixtures:
|
|
60
|
+
|
|
61
|
+
- `single-noauth`: standalone Redis without auth or TLS
|
|
62
|
+
- `single-auth`: standalone Redis with ACL auth
|
|
63
|
+
- `single-tls`: standalone Redis with TLS
|
|
64
|
+
- `cluster-auth`: two-node Redis Cluster with ACL auth and BullMQ `{bull}` prefix coverage
|
|
65
|
+
- `cluster-tls`: two-node Redis Cluster with TLS and BullMQ `{bull}` prefix coverage
|
|
66
|
+
- `sentinel-auth`: Redis master, two replicas, and three Sentinels with data-node ACL auth
|
|
67
|
+
- `sentinel-tls`: Redis master, two replicas, and three TLS-enabled Sentinels
|
|
68
|
+
|
|
69
|
+
The shared deployment test proves Node-RED load, connection, add/run delivery, required `basecasts` scheduler creation/removal, and absolute scheduler minute/second metadata. TLS fixtures use local self-signed test certificates and disable certificate verification for those Docker-only deployments. MemoryDB remains the certificate-verified TLS deployment path.
|
|
70
|
+
|
|
71
|
+
## AWS MemoryDB
|
|
72
|
+
|
|
73
|
+
MemoryDB tests are opt-in. Use environment variables only:
|
|
74
|
+
|
|
75
|
+
- `MEMORYDB_ENDPOINT`
|
|
76
|
+
- `MEMORYDB_PORT`
|
|
77
|
+
- `MEMORYDB_USERNAME`
|
|
78
|
+
- `MEMORYDB_PASSWORD`
|
|
79
|
+
- optional `MEMORYDB_TLS`
|
|
80
|
+
- explicit enable flag such as `MEMORYDB_ENABLED=1`
|
|
81
|
+
|
|
82
|
+
Run MemoryDB with the same deployment harness:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
MEMORYDB_ENABLED=1 npm run test:deployments
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Never write these values to repository files, examples, fixtures, snapshots, or logs.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
## Worker Does Not Receive Jobs
|
|
4
|
+
|
|
5
|
+
- Confirm `bull run` uses the same `bull-queue-server` as `bull cmd`.
|
|
6
|
+
- Confirm Redis is reachable from the Node-RED process.
|
|
7
|
+
- Confirm the queue name is correct.
|
|
8
|
+
- For scheduled jobs, BullMQ creates the next delayed job only as the previous scheduled job starts processing.
|
|
9
|
+
|
|
10
|
+
## Cluster `CROSSSLOT` Errors
|
|
11
|
+
|
|
12
|
+
Use a BullMQ prefix with a Redis Cluster hash tag, such as `{bull}`. This keeps BullMQ queue keys in the same slot for atomic operations.
|
|
13
|
+
|
|
14
|
+
## MemoryDB Connection Hangs
|
|
15
|
+
|
|
16
|
+
MemoryDB is a Cluster deployment and normally requires TLS from an EC2/VPC client that can reach the endpoint. Use Cluster mode, TLS, ACL username/password, and a reachable VPC network path.
|
|
17
|
+
|
|
18
|
+
## TLS Certificate Errors
|
|
19
|
+
|
|
20
|
+
Keep TLS verification enabled when possible. Provide the CA certificate or server name needed by the Redis deployment. Disable verification only for controlled deployments that cannot be configured with a trusted CA.
|
|
21
|
+
|
|
22
|
+
## Repeat Job Is Not Found
|
|
23
|
+
|
|
24
|
+
Legacy repeat lookup uses exact scheduler ids. Use `msg.schedulerId`, `msg.jobopts.jobId`, `msg.jobid`, or `msg.jobId` consistently.
|
|
25
|
+
|
|
26
|
+
## Bull v4 Queue Data Missing After Upgrade
|
|
27
|
+
|
|
28
|
+
Bull v4 Redis data is not automatically migrated. Drain or retire old queues before switching production flows to BullMQ.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
Import these files from the Node-RED editor with **Import > Clipboard**.
|
|
4
|
+
|
|
5
|
+
## `example_flow.json`
|
|
6
|
+
|
|
7
|
+
End-to-end compatibility flow for the `basecasts` queue. It includes the required scheduled job payload and cron expression, plus basic events, manual acknowledgement, and flow examples.
|
|
8
|
+
|
|
9
|
+
## `bullmq_features.json`
|
|
10
|
+
|
|
11
|
+
Small BullMQ feature examples that all use one local Redis queue config named `bullmq-features`.
|
|
12
|
+
|
|
13
|
+
- Delay: `delay: send later` sets `msg.jobopts.delay = 10000`.
|
|
14
|
+
- Priority: `priority: high priority` sets `msg.jobopts.priority = 1`.
|
|
15
|
+
- Deduplication: `dedupe: same job once` sets `msg.jobopts.deduplication.id` from `msg.payload`.
|
|
16
|
+
- Rate limit: `rate limit: 2 per second` sends `msg.cmd = "setGlobalRateLimit"` with `{ "max": 2, "duration": 1000 }`.
|
|
17
|
+
- Scheduler: `scheduler: every minute` adds a repeatable scheduler with `repeat.pattern`.
|
|
18
|
+
- Events: the `bull events` node emits completed, failed, delayed, deduplicated, duplicated, and progress events.
|
|
19
|
+
- Manual acknowledgement: `manual ack worker` sends a job through `bull job` progress and complete actions.
|
|
20
|
+
- Flow: `flow: parent plus child` sends a parent/child tree to `bull flow`.
|
|
21
|
+
|
|
22
|
+
Point `bullmq-features` at your Redis deployment before deploying the flow.
|
|
23
|
+
|
|
24
|
+
## `repeatable_jobs.json`
|
|
25
|
+
|
|
26
|
+
Dedicated repeatable job commands for the `basecasts` queue.
|
|
27
|
+
|
|
28
|
+
- `repeat: add basecasts job` sends `msg.cmd = "add"` with `msg.jobopts.repeat.cron`.
|
|
29
|
+
- `repeat: getRepeatableJobs` lists repeatable schedulers.
|
|
30
|
+
- `repeat: count` counts repeatable schedulers.
|
|
31
|
+
- `repeat: getRepeatableJobByKey` reads the scheduler id from `msg.payload` into `msg.jobid`.
|
|
32
|
+
- `repeat: removeRepeatableByKey` removes the scheduler id from `msg.payload`.
|
|
33
|
+
- `repeat: stopAndRemoveAllJobs` sends `msg.cmd = "stopAndRemoveAllJobs"` to remove schedulers and clean inactive jobs.
|
|
34
|
+
|
|
35
|
+
Use the add inject first, then inspect with get/count/get-by-key. Use remove-by-key for one scheduler or stopAndRemoveAllJobs for full cleanup.
|