Is it true that domain events must be handled in the same process? According to .NET Microservices: Architecture for Containerized .NET Applications, that is the standard approach. This rather radical statement raises some questions.
Let’s investigate this further.
How do DDD experts define a domain event?
Eric Evans: “Something happened that domain experts care about” src.
Vaughn Vernon: “Domain Events will help you … to share what has occurred within your model with the systems”.
However, Martin Fowler states: “The essence of a Domain Event is that you use it to capture things that can trigger a change to the state of the application” src. This differs slightly from the definitions above. But considering the note that “this material is in a very draft form,” we can exclude this definition from consideration.
Additionally, code opinion suggests that “Generally, Domain Events will be referred to as “Inside Events” because they don’t leave their boundary,” which does not imply that they must be handled in-process.
So, why the restriction to in-process handling?