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 store should fire events that are used by external systems #73

Open
imvision opened this issue Dec 6, 2020 · 3 comments
Open

Comments

@imvision
Copy link

imvision commented Dec 6, 2020

Typical use of events published by event store are to maintain materialized views and integration with other systems.

@jacqueskang
Copy link
Owner

Hi @imvision I decided not to adresse firing events for external systems because data stores usually support triggering events natively (e.g., DynamoDB Stream or CosmosDB change feed)
Otherwise one can always implement publishing events in domain repositories, or by inheriting the event stores provided in this library.

@imvision
Copy link
Author

imvision commented Dec 7, 2020

I was just doing some proof of concept for an accounting system using file persistence and realized that there was no way to build read models. Now I want to use MSSQL for the read model but only if the event store could trigger events after aggregates are persisted successfully. I guess I can create a base repository that can handle the publishing of events for all the inherited domain repos.

Thanks for response.

@BenjaminCharlton
Copy link

I hope you don't mind me posting this hear, Jaques. It seems relevant to this question.

I have built three libraries that extend yours so that it can be used to fire integration events used by external systems.

I have created base classes and interfaces that can be extended to use any ORM, database and dependency injection framework. I have also provided a full implementation for EF Core, SQL Server and Microsoft.Extensions.DependencyInjection.

They use the DotNetCore.CAP library to publish the integration events only when the domain event has been persisted successfully to the event store. I.e. using the "Outbox Pattern".

They are here:
https://github.com/BenjaminCharlton/JKangEventSourcingWithCap

They can also be downloaded as Nuget packages.
I hope it's helpful. I would welcome feedback (especially contributions) from you or anybody else interested.

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

No branches or pull requests

3 participants