An overview of events
We talked about messages in the previous section. Now, we are about to see those messages become events. So, let's dig into this before we learn about the Pub-Sub pattern.
An event is a message that represents something that happened in the past.
We can use events to divide a complex system into smaller pieces or have multiple systems talk to each other without creating tight couplings. Those systems could be subsystems or external applications, such as microservices.
We can regroup events into two broad categories:
- Domain events
- Integration events
Let's look at each in detail.
Domain events
A domain event is a term based on DDD that represents an event in the domain. This event could then trigger other pieces of logic to be executed subsequently. It allows a complex process to be divided into multiple smaller processes. These events can be executed sequentially or could be "fired and forgot." Domain events...