3.0.0
✨ Overview
This release introduces a breaking change to the IConsumer API in order to better align the client behavior with the AMQP protocol and the broker expectations.
The change makes message handling more explicit and correct, splitting the old overloaded Reject method into two separate methods: Modify and Reject.
⚠️ Breaking Changes
1. IConsumer.Reject Method Refactor
The previous method:
void Reject(Message message, bool undeliverableHere = false);has been replaced with two new methods:
void Modify(Message message, bool deliveryFailed, bool undeliverableHere);
void Reject(Message message);| Aspect | 2.16.0 | 3.0.0 |
|---|---|---|
| Method | Reject(Message message, bool undeliverableHere = false) |
Modify(...) and Reject(...) |
| Behavior | Always sent a Modified disposition internally |
Explicitly send Modified or Rejected based on method |
| Redelivery | Controlled by undeliverableHere parameter |
Controlled by deliveryFailed and undeliverableHere in Modify |
🛠 Migration Guide
If you previously had code like:
consumer.Reject(message); // default undeliverableHere = false✅ Update it to:
consumer.Modify(message, deliveryFailed: true, undeliverableHere: false);If you had:
consumer.Reject(message, undeliverableHere: true);✅ Update it to:
consumer.Modify(message, deliveryFailed: true, undeliverableHere: true);If you truly intend to reject the message (e.g., invalid message, poison message):
✅ Use:
consumer.Reject(message);✅ Please review your consumers before upgrading to 3.0.0!
New Contributors
- @vitorpmoreira made their first contribution in #522
Full Changelog: v2.16.0...v3.0.0