Skip to content

Log RabbitMQ dead-letter decisions before publication - #29

Merged
KilianBoute merged 1 commit into
mainfrom
feat/rabbitmq-dlq-decision-logs
Sep 18, 2026
Merged

KilianBoute merged 1 commit into
mainfrom
feat/rabbitmq-dlq-decision-logs

Conversation

@KilianBoute

Copy link
Copy Markdown
Member

Summary

Add optional RabbitOptions.SetLogger using the existing service logrus logger and models/pkg/api envelope. Emit one WARN dead_letter_requested before attempting a new DLQ publication.

Reuse the existing DeadLetterReason catalog: malformed, handler_error, retry_exhausted, publish_failed and unspecified. Include source/DLQ queue, attempts and already-decoded event traceId/media filename where available.

  • No new failure metadata, headers, message-handler signature or envelope schema.
  • No additional payload/envelope decoding, observer registration, async worker or buffer.
  • No decision log on normal forwards, cancellation, retries below the cap, or administrative scan/replay restoration.
  • No claim that publication succeeded; logs describe the decision, not delivery.
  • Existing acknowledgement, recovery and publishing behavior is unchanged.

Validation

  • GOWORK=off GOTOOLCHAIN=auto go test -race ./pkg/queue -count=1 -timeout=120s
  • GOWORK=off GOTOOLCHAIN=auto go vet ./pkg/queue
  • Sequence integration race tests and vet passed against this implementation.
  • Tests verify catalog/status fields, safe correlation, prepublish ordering, disabled logging, terminal vs nonterminal actions, unchanged payloads/settlement, and administrative exclusions.

Supersedes the diagnostic infrastructure approach in closed uug-ai/hub-pipeline-sequence#92. Existing optional DLQ observer remains available but is not needed or enabled by this approach.

Accept an optional service logger and emit one structured warning before new DLQ publication, using existing reason codes and already-decoded event correlation. Preserve payloads, retries, settlement and public handler APIs; no extra decoding, observers, or background workers are required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@KilianBoute
KilianBoute merged commit ce43820 into main Sep 18, 2026
4 checks passed
@KilianBoute
KilianBoute deleted the feat/rabbitmq-dlq-decision-logs branch September 18, 2026 14:37
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.32673% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/queue/rabbitmq.go 57.14% 23 Missing and 10 partials ⚠️

📢 Thoughts on this report? Let us know!

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