Skip to content

feat: DLQ auto-retry with exponential backoff#2

Open
Dafuriousis wants to merge 1 commit intodevelopfrom
feat/dlq-auto-retry
Open

feat: DLQ auto-retry with exponential backoff#2
Dafuriousis wants to merge 1 commit intodevelopfrom
feat/dlq-auto-retry

Conversation

@Dafuriousis
Copy link
Copy Markdown
Owner

Implements automated retry for DLQ entries with exponential backoff.

Changes:

  • Migration: ADD COLUMN permanently_failed BOOLEAN DEFAULT FALSE, next_retry_at TIMESTAMPTZ
  • TransactionDlq model: new fields
  • next_retry_at(): base_delay * 2^retry_count backoff function
  • TransactionProcessor::process_dlq_retries(): polls due entries every 60s,
    requeues as pending or marks permanently_failed after DLQ_MAX_RETRIES (default 5)
  • Emits transaction.dlq_exhausted webhook event on exhaustion
  • Config: DLQ_MAX_RETRIES, DLQ_BASE_DELAY_SECS env vars
  • main.rs: background worker spawned at startup
  • Tests: unit backoff calc, integration retry progression + permanent failure

- Migration: add permanently_failed, next_retry_at to transaction_dlq
- TransactionDlq model: new fields
- next_retry_at(): pure backoff fn (base_delay * 2^retry_count)
- TransactionProcessor::process_dlq_retries(): polls due entries,
  requeues as pending or marks permanently_failed after max retries
- Emits transaction.dlq_exhausted webhook event on exhaustion
- Logs each retry attempt with error_reason
- Config: DLQ_MAX_RETRIES (default 5), DLQ_BASE_DELAY_SECS (default 60)
- main.rs: spawn DLQ worker polling every 60s
- Tests: unit backoff calc, integration retry progression + permanent failure
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.

1 participant