Move message deletion from QueueManager into MessageWatchdog.RemoveMessages#172
Merged
Conversation
…ssages QueueManager no longer calls IMessageStore.DeleteMessages directly. Instead RemoveMessages now owns deletion: it deletes the handled positions from the store and then trims them from the watchdog's ignore-set (delete-before-trim so a no-longer-ignored position can't be re-fetched before it is gone from the store). The three QueueManager delete sites (Initialize replay, idempotency duplicate, AfterFlush) collapse to a single awaited RemoveMessages call. IMessageWatchdog.RemoveMessages gains the StoredId and becomes async; the hand-rolled QueueManager tests keep a one-line no-op stub.
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.
Summary
QueueManagerno longer deletes messages viaIMessageStore.DeleteMessagesdirectly. Deletion is now owned byMessageWatchdog.RemoveMessages, which deletes the handled positions from the store and drops them from its ignore-set in one step.What changed
IMessageWatchdog.RemoveMessages— nowTask RemoveMessages(StoredId storedId, IReadOnlyList<long> positions)(gained theStoredId, became async).MessageWatchdog.RemoveMessages— deletes from_messageStorefirst, then trims_pushedPositions. Delete-before-trim preserves the existing ordering so a no-longer-ignored position can't be re-fetched before it's gone from the store.QueueManager— the three delete sites (Initializereplay, idempotency-duplicate,AfterFlush) collapse from aDeleteMessages+RemoveMessagespair to a singleawait _messageWatchdog.RemoveMessages(_storedId, …)._messageStoreis still used forGetMessages(fetch), just no longer for deletes.QueueManagertests keep a one-line no-op stub (now async, matching the new signature).Testing