What happens if we lose some event(s) during transaction?

As you know Event Sourcing and CQRS are important topics for microservices. But have you ever thought, what happens if we do not throw any event(s) or lose some event(s) during transaction?

Neşeli Günler — https://youtu.be/l03DCLQH0RY

If you are going to leave a message to another service, don’t leave it directly to the message broker, write it in a table and read it from there.

The advantage of this is that we will never lose events anymore, and we will be able to launch them again if needed. As for the disadvantage, writing / reading events will be an extra cost for us. Of course, applying and using this pattern should be according to your needs.

So how do we implement it?

First, I start by creating the project structure. I preferred to proceed using onion architecture. Because Onion Architecutre, which is very convenient for DDD, it will provide you to separate the layers more accurately and responsibilities more. For more information on Onion Architecture, look at here.

Understanding Onion Architecture
After creating a user

I don’t know what’s happening here? | software engineer @trendyol