Skip to content

Route QueueManager message fetch through MessageWatchdog#175

Closed
stidsborg wants to merge 1 commit into
mainfrom
queuemanager-fetch-via-watchdog
Closed

Route QueueManager message fetch through MessageWatchdog#175
stidsborg wants to merge 1 commit into
mainfrom
queuemanager-fetch-via-watchdog

Conversation

@stidsborg

Copy link
Copy Markdown
Owner

Summary

Moves all IMessageStore.GetMessages access out of QueueManager and into MessageWatchdog, so the watchdog owns every store read (on-demand single-flow fetch + the existing replica poll loop).

  • New MessageFetcher delegate (StoredId, IReadOnlyList<long> skip) -> Task<IReadOnlyList<StoredMessage>> (signature-identical to IMessageStore.GetMessages).
  • QueueManager drops its IMessageStore dependency for a MessageFetcher; FetchAndNotify calls the delegate instead of the store.
  • MessageWatchdog.FetchMessages is the production target; wired via FunctionsRegistry -> InvocationHelper -> CreateQueueManager.
  • The 3 hand-rolled new QueueManager(...) tests pass functionStore.MessageStore.GetMessages (method-group -> delegate).

Design note

The on-demand fetch passes only the QueueManager's per-instance fetched positions as the skip set and deliberately does not consult the clearer's global pushed-set. Routing it through the global set would suppress re-delivery to a restarted/suspended flow on the same replica (the watchdog marks every fetched position pushed before routing, and FlowsManager.Push drops non-live flows) and hang it. Per-instance skip keeps subscribe-time and restart-from-replay behaviour identical to the previous in-QueueManager fetch.

Testing

  • Full solution builds clean.
  • All 459 in-memory tests pass (incl. suspension / postponed / subscription / restart-replay).
  • Store-backed tests pending (Docker was down locally) — running them now.

🤖 Generated with Claude Code

QueueManager no longer holds an IMessageStore. Its FetchAndNotify now
pulls through a MessageFetcher delegate wired to MessageWatchdog.FetchMessages,
so all IMessageStore.GetMessages access is owned by the watchdog (on-demand
single-flow fetch plus the existing replica poll loop).

The on-demand fetch passes only the QueueManager's per-instance fetched
positions as the skip set and does not consult the clearer's global pushed-set,
keeping subscribe-time and restart-from-replay behaviour identical to the
previous in-QueueManager fetch.
@stidsborg stidsborg closed this Jun 21, 2026
@stidsborg stidsborg deleted the queuemanager-fetch-via-watchdog branch June 21, 2026 06:32
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.

1 participant