Skip to content

remove x-dead-letter-routing-key to preserve original routing key on … - #9

Merged
lewisrenfrew merged 1 commit into
mainfrom
dlq-preserve-routing-key
Aug 25, 2026
Merged

lewisrenfrew merged 1 commit into
mainfrom
dlq-preserve-routing-key

Conversation

@lewisrenfrew

Copy link
Copy Markdown
Contributor

…dead letter

Copilot AI lite review requested due to automatic review settings August 25, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the RabbitMQ queue declaration logic to stop overriding the dead-letter routing key, so that messages retain their original routing key when dead-lettered (supporting correct requeue/back-routing behavior). It also bumps the package version and documents the change in the changelog.

Changes:

  • Remove x-dead-letter-routing-key from main queue arguments so RabbitMQ preserves the original routing key on dead-lettering.
  • Bump NuGet package version to 6.0.1.
  • Add a 6.0.1 changelog entry including an operational/deployment note about recreating existing queues.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/RabbitChannelConfiguration.cs Removes the x-dead-letter-routing-key argument from the declared queue to preserve original routing keys on dead-letter.
src/Linn.Common.Messaging.RabbitMQ.csproj Increments the package version from 6.0.0 to 6.0.1.
changelog.md Documents the behavior change and notes the need to recreate queues to avoid 406 precondition failures.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread changelog.md
Comment on lines +3 to +6
## [6.0.1] - 2026-08-25
### *Bug Fix*
- Remove `x-dead-letter-routing-key` from main queue arguments. Previously set to `""`, this caused RabbitMQ to overwrite the original routing key on dead-letter, making messages unroutable when requeued from the DLQ back to the original exchange. The original routing key is now preserved automatically.
- **Deployment note:** Any existing `.q` queue declared with this library must be deleted and recreated for this change to take effect. RabbitMQ will throw 406 PRECONDITION_FAILED if the queue already exists with the old arguments.
@lewisrenfrew
lewisrenfrew requested a review from a team August 25, 2026 10:35
@lewisrenfrew
lewisrenfrew merged commit b53295e into main Aug 25, 2026
2 checks passed
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.

3 participants