Skip to content

feat: BullMQ+Redis async job queue for Stellar tx (#272)#453

Merged
AnnabelJoe merged 2 commits into
AnnabelJoe:mainfrom
ladinoraa:issue-272-bullmq-job-queue
Jun 4, 2026
Merged

feat: BullMQ+Redis async job queue for Stellar tx (#272)#453
AnnabelJoe merged 2 commits into
AnnabelJoe:mainfrom
ladinoraa:issue-272-bullmq-job-queue

Conversation

@ladinoraa

Copy link
Copy Markdown
Contributor

Summary

Closes #272

Replaces the synchronous fire-and-forget Supabase queue with a proper BullMQ + Redis job queue, fully decoupling Stellar transaction submission from the HTTP request cycle.

Changes

  • src/lib/redis.ts — shared IORedis connection singleton
  • src/lib/queue.ts — rewritten with BullMQ Queue + Worker; 3 retries with exponential back-off (2s→4s→8s); dead-letter via BullMQ failed set; Supabase jobs table kept in sync for polling
  • src/instrumentation.ts — starts worker on server boot (Node.js runtime only)
  • .env.example — documents REDIS_URL
  • .github/workflows/ci.yml — Redis service + REDIS_URL in build env
  • supabase/migrations/20260604000010_jobs_dead_letter.sql — dead_lettered_at column

Acceptance criteria

  • BullMQ + Redis processes Stellar submissions async
  • API returns 202 Accepted with job ID immediately
  • Client can poll GET /api/jobs/:id for status
  • Failed jobs retried up to 3 times with exponential back-off
  • Dead-letter queue for permanently failed jobs

ladinoraa and others added 2 commits June 4, 2026 01:51
…oe#272)

- Replace fire-and-forget Supabase queue with BullMQ + ioredis
- Add src/lib/redis.ts — shared IORedis connection singleton
- Rewrite src/lib/queue.ts — Queue/Worker backed by Redis
  - API returns 202 Accepted with job ID immediately (unchanged)
  - Worker processes anchor_and_mint jobs asynchronously
  - 3 retries with exponential back-off (2 s → 4 s → 8 s)
  - Failed jobs kept in BullMQ failed set (dead-letter queue)
  - Supabase jobs table kept in sync for GET /api/jobs/:id polling
- Start worker in instrumentation.ts (server-side only)
- Add REDIS_URL to .env.example
- Add Redis service to CI workflow
- Add migration for dead_lettered_at column

Closes AnnabelJoe#272
@drips-wave

drips-wave Bot commented Jun 4, 2026

Copy link
Copy Markdown

@ladinoraa 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

@AnnabelJoe AnnabelJoe merged commit 37249f2 into AnnabelJoe:main Jun 4, 2026
5 of 14 checks passed
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement background job queue for Stellar transaction submission

2 participants