Skip to content

Add consistent dead letter queue exception metadata across all transports#2265

Merged
jeremydmiller merged 1 commit intomainfrom
feature/transport-dead-letter-metadata-and-querying
Mar 5, 2026
Merged

Add consistent dead letter queue exception metadata across all transports#2265
jeremydmiller merged 1 commit intomainfrom
feature/transport-dead-letter-metadata-and-querying

Conversation

@jeremydmiller
Copy link
Member

Summary

  • Add StampFailureMetadata() helper to DeadLetterQueueConstants that stamps exception-type, exception-message, exception-stack, and failed-at headers on envelopes before moving to DLQ
  • Apply consistent metadata stamping to all transport MoveToErrorsAsync implementations: SQS, GCP Pub/Sub, Azure Service Bus (inline + batched), NATS, Pulsar, RabbitMQ (InteropFriendly), BufferedReceiver, and DurableReceiver
  • Add UseEnhancedDeadLettering option for RabbitMQ that publishes failed messages to DLQ with metadata headers instead of using native NACK-based dead lettering
  • Standardize NATS dead letter headers from non-standard x-dlq-* to DeadLetterQueueConstants headers (keeping x-dlq-original-subject as supplementary)

Test plan

  • Unit tests for StampFailureMetadata helper (4 tests passing)
    • Verifies all four headers are set correctly
    • Verifies pre-existing headers are preserved
    • Handles null stack trace gracefully
    • Overwrites previous failure headers on re-stamp
  • Integration tests for each transport with docker-compose infrastructure
  • RabbitMQ enhanced dead lettering integration test

🤖 Generated with Claude Code

…orts

Add StampFailureMetadata helper to DeadLetterQueueConstants that stamps
exception-type, exception-message, exception-stack, and failed-at headers
on envelopes before moving to DLQ. Applied consistently to SQS, GCP Pub/Sub,
Azure Service Bus, NATS, Pulsar, RabbitMQ (InteropFriendly), BufferedReceiver,
and DurableReceiver. Add UseEnhancedDeadLettering option for RabbitMQ that
publishes to DLQ with metadata headers instead of native NACK.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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