Getting Components to Do Things
Asynchronous messages are what make service-based architectures possible. We’ll just call messages from here on, but they come in two flavors: commands and events.
Commands are requests to do something. Maybe that’s transferring some funds, or maybe that’s sending an email. Whatever the desired operation is, commands are merely requests. The Component that handles a given command chooses whether or not to carry it out.
Components produce events in response to commands. Events are records of things that have happened. That means whatever they represent, it’s already done. You don’t have to like it, but you do have to deal with it.
Commands and events, collectively messages, are moved around in the system via ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access