Skip to content

feat(backend): implement unified BullMQ notification queue worker (#506)#577

Merged
Mosas2000 merged 1 commit into
StellaBridge:mainfrom
Yusufolosun:feature/notification-queue-worker
Jun 3, 2026
Merged

feat(backend): implement unified BullMQ notification queue worker (#506)#577
Mosas2000 merged 1 commit into
StellaBridge:mainfrom
Yusufolosun:feature/notification-queue-worker

Conversation

@Yusufolosun
Copy link
Copy Markdown
Contributor

Closes #506

Summary

Implements a dedicated BullMQ-based notification queue worker unifying delivery across email, webhook, and in-app (WebSocket) channels.

Changes

notificationQueue.worker.ts — new worker with:

  • Unified deliverEmail, deliverWebhook, and deliverInApp delivery handling
  • Central retry policies via retryPolicyService with exponential backoff and jitter
  • Priority mapping (critical / high / medium / low → BullMQ queues 1–4)
  • Delivery duration and status metrics via MetricsCollector singleton
  • In-app broadcasts over WebSocket "alerts" channel via wsServer.broadcastToChannel

index.ts — wired into application lifecycle:

  • initNotificationQueueWorker called on startup after the Webhook worker
  • stopNotificationQueueWorker called on shutdown before the Webhook worker

notificationQueue.worker.test.ts — unit tests covering:

  • enqueueNotification job priorities
  • Metric dispatching and channel logic
  • Worker lifecycle methods
  • Isolated from Redis, DB, and mailer via vi.hoisted mocks

Testing

  • npm run build — 0 type errors
  • npx eslint — clean, no errors or warnings
  • npx vitest run — 8/8 tests pass

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@Yusufolosun Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Mosas2000 Mosas2000 merged commit 70a983f into StellaBridge:main Jun 3, 2026
15 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Notification Queue Worker

2 participants