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

10 KiB

Partner DLQ API - Complete Documentation Index

📚 Quick Navigation

🚀 Getting Started

  1. Quick Start Guide - Start here!

    • Web dashboard access
    • API quick examples
    • CLI tool usage
    • Common operations
  2. Deployment Checklist

    • Pre-deployment verification
    • Step-by-step deployment
    • Post-deployment configuration
    • Rollback procedures

📖 Reference Documentation

  1. API Specification

    • Complete endpoint reference
    • Request/response schemas
    • Authentication details
    • Usage examples (curl, JavaScript)
  2. Operations Guide

    • System architecture
    • Error categories
    • Configuration reference
    • Troubleshooting procedures
    • Monitoring recommendations
  3. Implementation Details

    • Technical architecture
    • Code structure
    • Error categorization logic
    • Processing decision trees
    • Performance characteristics
  4. Architecture Diagrams

    • System overview
    • Message flow
    • Error categorization
    • API structure
    • Security flow

📂 File Structure

Code Files

server/
├── controllers/
│   └── partner_dlq.js                    # Main DLQ controller (600+ lines)
│
├── routes/
│   └── partner.js                        # DLQ routes (modified)
│
├── workers/
│   └── partner_dlq_handler.js            # Background DLQ worker (existing)
│
├── scripts/
│   ├── monitor_partner_dlq.js            # CLI monitoring tool (existing)
│   └── test_dlq_api.sh                   # API test suite (new)
│
└── public/
    └── dlq-monitor.html                  # Web dashboard (500+ lines)

Documentation Files

server/
├── PARTNER_DLQ_API_SUMMARY.md            # Complete implementation summary
├── README.md                             # Updated with DLQ section
│
└── docs/
    ├── PARTNER_DLQ_QUICKSTART.md         # Quick start guide
    ├── PARTNER_DLQ_API.md                # API reference
    ├── PARTNER_DLQ_HANDLING.md           # Operations guide
    ├── PARTNER_DLQ_IMPLEMENTATION.md     # Technical details
    ├── PARTNER_DLQ_ARCHITECTURE_DIAGRAMS.md # Visual diagrams
    ├── PARTNER_DLQ_DEPLOYMENT_CHECKLIST.md  # Deployment guide
    └── Partner_DLQ_API.postman_collection.json # Postman collection

🎯 Use Case Index

For Administrators

Daily Operations:

Troubleshooting:

Reporting:

For Developers

Integration:

Architecture:

Testing:

For DevOps

Deployment:

Monitoring:

Operations:


🔍 Quick Reference

Common Commands

# Web Dashboard
open http://localhost:3000/dlq-monitor.html

# CLI Monitoring
node scripts/monitor_partner_dlq.js

# Get Statistics
curl -H "Authorization: Bearer $TOKEN" \
  http://localhost:3000/api/dlq/partner_tasks/stats

# Process DLQ (Dry Run)
curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"dryRun": true}' \
  http://localhost:3000/api/dlq/partner_tasks/process

# Run Test Suite
./scripts/test_dlq_api.sh

# Start Background Handler
pm2 start workers/partner_dlq_handler.js --name partner-dlq-handler -- monitor

API Endpoints Summary

Endpoint Method Purpose
/api/partners/dlq/stats GET Get statistics
/api/partners/dlq/messages GET View messages
/api/partners/dlq/process POST Process DLQ
/api/dlq/:queueName/retryAll POST Retry all messages
/api/dlq/:queueName/retryByPosition POST Retry by position
/api/dlq/:queueName/retryByHeader POST Retry by header
/api/partners/dlq/purge DELETE Purge queue

Error Categories

Category Description Action
🔵 Transient Network/connection issues Auto-retry < 2h
🔴 Validation Invalid data Archive immediately
🟠 Processing Parse/calculation errors Manual review
Infrastructure Database/filesystem Retry with backoff
🟣 Partner API Auth/rate limiting Retry with delay
Unknown Unclassified Manual review

Configuration Variables

# Queue Settings
QUEUE_NAME_PARTNER=partner_tasks  # Auto-prefixes with 'dev_' in development mode
PARTNER_MAX_RETRIES=5

# DLQ Settings  
DLQ_CHECK_INTERVAL=300000      # 5 minutes
MAX_DLQ_AGE_MS=86400000        # 24 hours
AUTO_RETRY_WINDOW_MS=7200000   # 2 hours

📞 Getting Help

Documentation Issues

If you find errors or missing information in the documentation:

  1. Check the Implementation Details for technical depth
  2. Review Architecture Diagrams for visual explanations
  3. Contact the development team

Technical Issues

For technical problems:

  1. Check Troubleshooting Guide
  2. Review Operations Guide
  3. Check application logs
  4. Contact on-call engineer

Feature Requests

To request new features:

  1. Review Future Enhancements
  2. Document use case
  3. Submit feature request to product team

🔄 Version History

v1.0.0 (October 2, 2025) - Initial Release

Features:

  • 6 REST API endpoints
  • Web dashboard with auto-refresh
  • Error categorization (6 types)
  • Intelligent processing rules
  • Manual retry/archive operations
  • Comprehensive documentation
  • Test suite
  • Postman collection

Files:

  • Created: 11 new files
  • Modified: 2 existing files
  • Total Lines: ~5000+ lines of code and documentation

Status: Production Ready


📊 Documentation Statistics

Document Lines Purpose
Quick Start ~300 Getting started guide
API Spec ~500 Complete API reference
Operations ~400 Operational procedures
Implementation ~800 Technical details
Architecture ~600 Visual diagrams
Deployment ~500 Deployment guide
Total ~3100+ Complete documentation

🎓 Learning Path

Beginner (New Administrators)

  1. Start with Quick Start Guide
  2. Explore Web Dashboard
  3. Try CLI tool
  4. Read Operations Guide

Intermediate (Developers)

  1. Review API Specification
  2. Study Architecture Diagrams
  3. Test with Postman Collection
  4. Read Implementation Details

Advanced (DevOps/Architects)

  1. Study Implementation Details
  2. Review Deployment Checklist
  3. Configure monitoring and alerts
  4. Plan integration with existing systems

🚀 Next Steps

Immediate

  • Read Quick Start Guide
  • Access web dashboard
  • Run test suite
  • Review API documentation

Short Term

  • Deploy to staging environment
  • Train administrators
  • Configure monitoring
  • Test with real data

Long Term

  • Deploy to production
  • Set up automated processing
  • Implement advanced features
  • Optimize performance

📝 Document Maintenance

This index is maintained as part of the Partner DLQ API documentation.

Last Updated: October 2, 2025
Version: 1.0.0
Maintainer: Development Team

For corrections or updates, please contact the development team.


Ready to start?Quick Start Guide