jezzsantos / saastack

A comprehensive codebase template for starting your real-world, fully featured SaaS web products. On the .NET platform
The Unlicense
15 stars 5 forks source link

Improve Event Notification #30

Closed jezzsantos closed 3 months ago

jezzsantos commented 3 months ago

Presently, we have a couple issues with the eventing pattern for notification.

Domain Events are meant to cross subdomains boundaries, but remain inside bounded contexts, whereas Integration events can cross bounded contexts into the universe. We need to materalize that difference in the whole mechanism of IEventNotificationRegistration s.

Second problem is that we can only register one IEventNotificationRegistration in the call to service.RegisterUnTenantedEventing() that is done in each subdomain module (which is the source of the domain events. Ultimately, we need to be able to register many IEventNotificationRegistration (one in each subdomain) and have the implementations of these "handlers" injected into the DI container by other subdomain modules (to avoid illegal references).

Third problem is that the EventNotificationNotifier is only handling a single IEventNotificationRegistration that it finds related to the Producer of the same type of the source aggregate that is publishing its events. We should be finding all IEventNotificationRegistrations