This is a refresher of PR #9620. It was requested to come back with these changes after HA/Mirroring queues were deprecated.
Here I include the previous PR description:
The rabbit_backing_queue:discard callback is passing the message ID to the implementer. This is often not enough to carry on some necessary work as it's seen in the rabbit_priority_queue comment.
In the above issue a consumer starts consuming with noAck over an empty queue. A publisher publishes a single message which gets forwarded directly to the consumer. In this case, the discard callback is invoked instead of publish_delivered and therefore it's header is not removed from the deduplication cache.
Problem is the discard callback only forwards the message ID and not the whole message not providing enough context for the implementer.
This patch adjust the rabbit_backing_queue behaviour passing the whole message to the discard callback instead of its sole ID.
Types of Changes
What types of changes does your code introduce to this project?
[x] Bug fix (non-breaking change which fixes issue #NNNN)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause an observable behavior change in existing systems)
[ ] Documentation improvements (corrections, new content, etc)
Proposed Changes
This is a refresher of PR #9620. It was requested to come back with these changes after HA/Mirroring queues were deprecated.
Here I include the previous PR description:
The
rabbit_backing_queue:discard
callback is passing the message ID to the implementer. This is often not enough to carry on some necessary work as it's seen in the rabbit_priority_queue comment.In my particular case, this makes it hard to fix the following issue: https://github.com/noxdafox/rabbitmq-message-deduplication/issues/96
In the above issue a consumer starts consuming with noAck over an empty queue. A publisher publishes a single message which gets forwarded directly to the consumer. In this case, the discard callback is invoked instead of publish_delivered and therefore it's header is not removed from the deduplication cache.
Problem is the discard callback only forwards the message ID and not the whole message not providing enough context for the implementer.
This patch adjust the rabbit_backing_queue behaviour passing the whole message to the discard callback instead of its sole ID.
Types of Changes
What types of changes does your code introduce to this project?
Checklist
CONTRIBUTING.md
document