Asynchronous integration with messages
So far in this book, we have only talked about events, so what exactly is a message? An event is a message, but a message is not always an event. A message is a container with a payload, which can also be an event and can have some additional information in the form of key-value pairs.
A message may be used to communicate an event, but it may also be used to communicate an instruction or information to another component.
The kinds of payloads we will be using in this book include the following:
- Integration event: A state change that is communicated outside of its bounded context
- Command: A request to perform work
- Query: A request for some information
- Reply: An informational response to either a command or query
The first kind of message we will be introduced to and will implement is an integration event. The term integration event comes from how it is used to integrate domains and bounded contexts. This is how...