Using messaging and events
Microservice components need to send information between each other; however, traditionally, the sender would wait for a reply from the recipient before continuing. An example would be an application that accepts user input and returns a result.
This behavior can cause blocking as one component depends on another, and the more pieces you have that are responsible for discreet operations, the more they must communicate.
To prevent blocking, two alternate patterns are available – events and messaging. Both mechanisms work at a basic level in the same way – they inform other components, either directly or indirectly, but they don't wait for a reply.
Events are notifications to other system components that have happened, but they do not contain any data, although they may include a reference. When events are triggered, they don't expect another component to necessarily do something. It is the job of a consuming component to decide...