Patterns for message-driven implementation
If we rely on message-based communication, we avoid tight coupling, enhance elasticity, as the components can grow or shrink without worrying about other components, and handle failure conditions, as one component's issues will not propagate to other components.
The following are the main design patterns one needs to be aware of when using reactive application programming.
Event-driven communication pattern
Event-driven communication is when two or more components message each other based on some event. An event can be adding new data, updating the data state, or removing data. For example, on addition of a new employee record to the system, an email needs to be sent to the manager. So the service or component responsible for managing employee records will message the component responsible for the emailing functionality on addition of a new record. There are multiple ways to handle this communication, but the most common method is through Message queues...