Skip to content

Expose actual RabbitMQ dead-letter publish outcomes - #28

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

KilianBoute merged 1 commit into
mainfrom
feat/rabbitmq-dlq-observability

Conversation

@KilianBoute

Copy link
Copy Markdown
Member

Summary

Add an optional DeadLetterObserver callback to RabbitOptions so consumers can log actual DLQ publication outcomes instead of inferring them from handler actions.

  • Emit once after the final logical publish result, including reconnect attempts, outside publisher locks and before recovery/settlement.
  • Distinguish confirmed success, unconfirmed publication, and failed publication; Confirmed is true only on a successful confirmed transfer.
  • Include actual source/DLQ queues, reason, retry attempts and allowlisted traceId/media filename correlation. Never expose message bodies or credentials through the callback.
  • Cover runtime dead-lettering, retry exhaustion, forced raw transfers and explicit administrative publication; exclude inspection, replay and discard restoration.
  • Preserve existing ack, retry, recovery and publishing behavior. No callback is installed by default; callbacks must return promptly and be concurrency-safe.

Validation

Focused mocked outcome, correlation, entry-point, reconnect, retry-exhaustion, settlement, recovery and restoration tests passed, including race checks and vet. Sequence integration passes race tests and vet against this implementation. Live RabbitMQ integration tests were not run.

Scope

RabbitMQ client-initiated publication only. Broker-side dead-letter policies are not visible to this observer. This API enables a separate hub-pipeline-sequence structured-logging follow-up.

Add an opt-in payload-free observer after logical DLQ publish completion, including reconnect and confirmation outcomes. Preserve settlement semantics and exclude administrative restoration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.16393% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/queue/rabbitmq.go 70.00% 4 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@KilianBoute
KilianBoute merged commit 7b05e09 into main Sep 18, 2026
5 checks passed
@KilianBoute
KilianBoute deleted the feat/rabbitmq-dlq-observability branch September 18, 2026 13:45
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