Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Subscription Improvements #3110

Closed
jeremydmiller opened this issue Apr 2, 2024 · 3 comments
Closed

Event Subscription Improvements #3110

jeremydmiller opened this issue Apr 2, 2024 · 3 comments

Comments

@jeremydmiller
Copy link
Member

Just tracking work for finally building out a first class subscription model for Marten events that uses the async daemon, but doesn't necessarily force you to build custom IProjection

  • True "first class subscriptions" where it skips the grouped projection model that the daemon uses today, and wouldn't take part in rebuilds
  • "Side Effects", being able to just register or do a callback that says "hey, I've got a projection updated, do you want to make other changes like in some kind of outbox of your own"
  • Side Effects from Aggregation Projections #2533 -- Appending events from a projection
  • Mechanism to Import Events #1435 -- Bulk writing events might actually be enabled by the "append event in projections"
@jeremydmiller
Copy link
Member Author

jeremydmiller commented Apr 3, 2024

Tasks

  • Add ability to register IChangeListener to EventRange that subscriptions can use
  • ProjectionUpdateBatch.PostUpdateAsync() should look for IChangeListener objects on EventRange
  • ProjectionOptions.AllShards() should return the shards from projections too
  • SubscriptionWrapper so you can directly apply ISubscription
  • AddSubscriptionWithServices<T>(Lifecycle) where T is ISubscription. Add option for AsyncOptions`. Take in name as well
  • Validate on uniqueness of subscription names w/ projection names
  • Docs of course
  • Xml API comments

Rewind

  • IProjectionDaemon.RewindSubscriptionAsync(name)

Test Plan

  • Subscriptions are coming through ProjectionOptions.AllShards()
  • Can run a very simple subscription that just records the events it receives, full stop

Tasks from Wolverine Integration

  • New interface for ISubscriptionAgent called ISubscriptionController that only has Task ReportCriticalFailureAsync(Exception ex); and `Task RecordDeadLetterEventAsync(DeadLetterEvent @event);
  • New overload of RecordDeadLetterEventAsync(IEvent, Exception) to simplify the usage
  • ReportCriticalFailureAsync overload that takes the furthest ceiling, and that gets the new progress. Update the new progress internally
  • In Wolverine, use the new ISubscriptionController in the ISubscription interface so you don't depend on Agent being set on EventRange

@jeremydmiller
Copy link
Member Author

This work is somewhat pending on the matching work with Wolverine. I'm using a local copy of Marten with Wolverine to flush out any remaining issues

@jeremydmiller
Copy link
Member Author

Closed by #3115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant