Skip to content

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

Open
ladinoraa wants to merge 1 commit into
AnnabelJoe:mainfrom
ladinoraa:issue-272-bullmq-job-queue
Open

feat: BullMQ+Redis async job queue for Stellar tx (#272)#453
ladinoraa wants to merge 1 commit 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

…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
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.

Implement background job queue for Stellar transaction submission

1 participant