Skip to content

Commit 711ea48

Browse files
authored
feat: CCP-6150-Migrate queueing from Bull to BullMQ (#286)
* Migrate queueing from Bull to BullMQ Replaced Bull with BullMQ across backend queues, workers, and tests, including typed Queue/Job usage, new Queue/Worker/QueueEvents creation helpers, and a dedicated `:mq` Redis key prefix to isolate BullMQ keys. Introduced shared job policy utilities (`job-options.ts`) for retry/backoff/retention, refactored worker execution into QueueModule-managed processors, and extracted shared delivery logic into `DeliveryWorker`, `MergeBatchRunner`, and `DeliveryFailureHandler`. Updated monitoring, reconciliation, webhook delivery, cancel/reschedule job handling, and load-test drain scripts/workflow to match BullMQ semantics and naming. * Parallelize queueing and normalize errors Sonarqube fixes * Fixing merge conflict mis-merge
1 parent aecd7c1 commit 711ea48

55 files changed

Lines changed: 3573 additions & 3184 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/load-test.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
with:
8383
path: ./tests/load/drain-test.js
8484

85-
# Sample Bull queue depth in Redis until empty → drain rate + peak depth.
85+
# Sample BullMQ queue depth in Redis until empty → drain rate + peak depth.
8686
- name: Measure queue drain
8787
if: always()
8888
continue-on-error: true # measurement must never block the ramps that follow
@@ -125,15 +125,15 @@ jobs:
125125
exit 0
126126
fi
127127
llen() { n=$(rc LLEN "$1" | tr -dc '0-9'); echo "${n:-0}"; }
128-
# Bull keys are namespaced per deployment (REDIS_KEY_PREFIX, defaulting to
128+
# Queue keys are namespaced per deployment (REDIS_KEY_PREFIX, defaulting to
129129
# RELEASE_NAME) because every deployment in the namespace shares one Redis.
130130
PREFIX=$(oc get deploy "$DEP" -o jsonpath='{.spec.template.spec.containers[*].env[?(@.name=="RELEASE_NAME")].value}' 2>/dev/null)
131131
PREFIX=${PREFIX:-notify}
132-
echo "bull key prefix: $PREFIX"
132+
echo "queue key prefix: $PREFIX:mq"
133133
depth() {
134134
t=0
135135
for q in notification-ingestion email-delivery; do
136-
for s in wait active; do t=$((t + $(llen "$PREFIX:$q:$s"))); done
136+
for s in wait active; do t=$((t + $(llen "$PREFIX:mq:$q:$s"))); done
137137
done
138138
echo "$t"
139139
}

‎backend/package-lock.json‎

Lines changed: 88 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎backend/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@nestjs/typeorm": "^12.0.0",
3737
"axios": "^1.20.0",
3838
"body-parser": "^2.3.0",
39-
"bull": "^4.14.1",
39+
"bullmq": "^6.3.19",
4040
"class-transformer": "^0.5.1",
4141
"class-validator": "^0.15.0",
4242
"express-prom-bundle": "^8.0.0",

0 commit comments

Comments
 (0)