feat: BullMQ+Redis async job queue for Stellar tx (#272)#453
Open
ladinoraa wants to merge 1 commit into
Open
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 singletonsrc/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 pollingsrc/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 envsupabase/migrations/20260604000010_jobs_dead_letter.sql— dead_lettered_at columnAcceptance criteria