How To Implement Event Sourcing & Publish Integration Event To Event Bus While Using Asp.Net Core Identity

460 Views Asked by At

In my clean architecture project I am using asp.net core identity UserManager class for managing users.

I have abstracted the methods of UserManager class to IUserManager interface inside the Application Layer of my clean architecture core project.

I couldn't figure out how to achieve Automicity with event sourcing and publish integration event to event bus.

1

There are 1 best solutions below

0
Kamal Hosseini On

A Domain event can be consumed using an INotificationHandler(in MediatR). Below is a link to a clean architecture template (written by Jason Taylor) that uses Demain Event.

https://github.com/jasontaylordev/CleanArchitecture/tree/main/src/Application/TodoItems/EventHandlers

The Masstransit system is a very simple way to produce and consume messages for integration events.

https://masstransit-project.com/usage/producers.html#publish

https://masstransit-project.com/usage/consumers.html#consumer