Skip to content

feat: add LoggingListenerDispatcher and promote recoverStuck* onto store interfaces - #11

Merged
jcviljoen merged 1 commit into
mainfrom
add-logging-dispatcher-and-update-event-store-contracts
May 17, 2026
Merged

feat: add LoggingListenerDispatcher and promote recoverStuck* onto store interfaces#11
jcviljoen merged 1 commit into
mainfrom
add-logging-dispatcher-and-update-event-store-contracts

Conversation

@jcviljoen

Copy link
Copy Markdown
Collaborator

Summary

  • LoggingListenerDispatcher — new readonly decorator that logs every failed dispatch attempt at error level (PSR-3) with ['exception', 'event', 'listener'] context, then rethrows so upstream redelivery scheduling/rescheduling still triggers. Wrap outside DefaultListenerDispatcher so its ignoredExceptions never reach the logger; wrap inside RedeliveringListenerDispatcher (event path) and SequentialRedeliveryProcessor (redelivery path) so every attempt is logged. Closes the visibility gap where SequentialRedeliveryProcessor would exhaust retries silently.
  • recoverStuckEvents() / recoverStuckRedeliveries() promoted onto the interfaces — moved from SqlEventStore / SqlRedeliveryStore up to EventStore / RedeliveryStore. Recovery jobs can now type-hint against the interface instead of instanceof-checking down to the concrete SQL class. InMemory* implementations satisfy the contract (events: returns 0; redeliveries: resets stuck Dispatching rows via queueForImmediateRetry()).
  • README updated — new class-table row, "Per-attempt failure logging" section with wiring example, re-anchored SqlEventStore::recoverStuck* references to the interface, refreshed Custom EventStore example.

🤖 Generated with Claude Code

…ore interfaces

LoggingListenerDispatcher logs every failed dispatch via PSR-3 with
event + listener context and rethrows so upstream redelivery still
triggers — gives operators per-attempt visibility into retries that
SequentialRedeliveryProcessor previously exhausted silently.

recoverStuckEvents() and recoverStuckRedeliveries() move from the
SQL classes to their respective interfaces so recovery jobs can
type-hint against the contract instead of instanceof-checking down.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jcviljoen
jcviljoen merged commit c612cdf into main May 17, 2026
1 check passed
@jcviljoen
jcviljoen deleted the add-logging-dispatcher-and-update-event-store-contracts branch May 17, 2026 20:56
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