Skip to content

[BE-27] Implement BullMQ job queue for async asset processing in opsce module #752

@yusuftomilola

Description

@yusuftomilola

Problem

Operations like PDF generation, Stellar contract calls, and bulk exports are slow synchronous operations that block the request-response cycle. bull and @nestjs/bull are available but not configured.

Proposed Solution

Create backend/src/opsce/queue/ with a QueueModule, an AssetProcessor for asset-related jobs, and a queue producer service. Use Redis as the BullMQ backend.

Acceptance Criteria

  • QueueModule configured with Redis using REDIS_HOST and REDIS_PORT env variables
  • asset-processor handles: generate-pdf and stellar-tokenize job types
  • Jobs have 3 retry attempts with exponential backoff on failure
  • GET /api/assets/:id/report enqueues a generate-pdf job and returns a jobId immediately
  • GET /api/queue/jobs/:jobId returns job status (waiting/active/completed/failed)
  • Failed jobs log structured error details including jobId, type, and error message

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions