agmission/Development/server/docs/archived/PARTNER_DLQ_CODE_ARCHIVED.md

2.6 KiB

Partner DLQ Code - Archived

Date Archived: December 22, 2025
Reason: Replaced by global DLQ architecture


Archived Files

  • partner_dlq.js (route) - Partner-specific DLQ routes
  • partner_dlq.js (controller) - Partner-specific DLQ controller

Replacement

These files have been replaced by the global DLQ system:

Old File New File Status
routes/partner_dlq.js routes/dlq.js Active
controllers/partner_dlq.js controllers/dlq.js Active

Migration Path

Old Endpoints (partner-specific):

POST /api/partners/dlq/:queueName/retryAll
POST /api/partners/dlq/:queueName/retryByPosition
POST /api/partners/dlq/:queueName/retryByHeader
GET  /api/partners/dlq/messages
POST /api/partners/dlq/process
DELETE /api/partners/dlq/purge

New Endpoints (global, all queues):

POST /api/dlq/:queueName/retryAll
POST /api/dlq/:queueName/retryByPosition
POST /api/dlq/:queueName/retryByHeader
GET  /api/dlq/:queueName/messages
GET  /api/dlq/:queueName/stats
DELETE /api/dlq/:queueName/purge

Key Differences

Old Architecture (Partner-Specific)

  • Routes at /api/partners/dlq/*
  • Hardcoded to partner_tasks queue
  • Mixed MongoDB tracker operations with queue operations
  • Would require duplication for each new queue type

New Architecture (Global)

  • Routes at /api/dlq/:queueName/*
  • Works with ANY queue (partner_tasks, jobs, notifications, etc.)
  • Pure RabbitMQ queue-native operations
  • No code duplication needed for new queues

Why Archived?

  1. Global Architecture: New design supports unlimited queue types without duplication
  2. Queue-Native: Direct RabbitMQ operations, no MongoDB coupling
  3. Consistency: Single API pattern for all DLQ operations
  4. Maintainability: One codebase to maintain instead of multiple queue-specific implementations

Preserved for Historical Reference

These files are preserved to:

  • Document the evolution of the DLQ system
  • Assist in understanding migration decisions
  • Provide reference for any legacy code that might reference these patterns
  • Show the progression from partner-specific to global architecture

Status: Archived (not loaded by server, replaced by global DLQ)