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

Changed Integration Events to be considered similar to DomainEvents and manageable from the DomainEntity #96

Merged
merged 10 commits into from
Sep 28, 2023

Conversation

fabiomaistro
Copy link
Collaborator

@fabiomaistro fabiomaistro commented Sep 26, 2023

Description

  • IntegrationEvent(s) are now a special type of DomainEvent(s)
  • It's now possible to raise Integration Events from domain entities inheriting from DomainEntity
  • It's now possible to register an IntegrationEventDispatcher and integration events will be dispatched BEFORE the SaveChanges happen in EF

Notes:

  • Given that integration events are just a special version of domain events, the activation of integration events implies also the activation of domain events
  • At the current stage, integration events are NOT persisted in the database like domain events
  • At the current stage, it's NOT possible to inject the DomainContext within the IntegrationEventDispatcher implementation (that will cause Autofac to raise a StackOverflowException)

Motivation and Context

The change is motivated by the idea that it should be possible to raise integration events before domain entities are saved in the database in a similar way to what it's done for domain events. The dispatching of the integration events and its handling are responsibility of the user of these libraries.

Testing

Tested in a specific branch of Obelisk.
Usage example:

image

@fabiomaistro fabiomaistro changed the title Topic/fm interception integration events Changed Integration Events to be considered similar to DomainEvents and manageable from the DomainEntity Sep 26, 2023
@fabiomaistro fabiomaistro marked this pull request as ready for review September 27, 2023 11:35
@fabiomaistro fabiomaistro merged commit e072371 into main Sep 28, 2023
@fabiomaistro fabiomaistro deleted the topic/fm-interception-integration-events branch September 28, 2023 11:48
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.

2 participants