Repository navigation
Cancel the consumer before requeueing a refused delivery, require a true handler result - #145
Merged
Merged
Conversation
…true` handler result - `Adapter::subscribe()` cancels the consumer before it nacks the refused delivery, so the broker doesn't deliver the requeued message to the consumer that is stopping. - A delivery counts as handled only when the handler returns `true`, in both `Adapter::subscribe()` and `ExistingMessagesConsumer`.
KalimeroMK
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #143.
Adapter::subscribe()now cancels the consumer first and requeues the delivery after that. Before, the delivery was requeued while the consumer was still registered, so the broker could deliver it straight back to the stopping consumer, where it stayed unacknowledged until the channel was closed.true, as thecallable(MessageInterface): boolcontract says and asInMemoryAdapterin yiisoft/queue does.ExistingMessagesConsumeracknowledged any truthy result but stopped unless it wastrue; withstrict_typesa non-boolean result failed there with aTypeError. Both now requeue such a delivery and stop.