Message-driven

Reactive systems are message-driven; not because we need message-driven systems but much rather because message-driven systems are those that can deliver responsiveness, resilience, and elasticity at the same time.

Message-driven architecture means that the information travels between the components disconnected. One component sends a message and then forgets it. It does not wait for the other component to act upon the message. When the message is sent, all the tasks on behalf of the sending component are performed and all the resources needed to handle the tasks are released, resulting in the message being released and ready to be used for the next task.

Message-driven does not necessarily mean networking. Messages can travel between objects, threads, and processes inside the same machine. On the other hand, if the interfaces to the messaging architecture are well-designed, then the components do not need to be modified if the infrastructure changes and the messages that were previously passing between threads will now have to travel through the ocean in IP packets.

Sending messages makes it possible to isolate the sender and the receiver in space and time, just as we described, as a means for elasticity. The receiver may pick up the message some time after it arrived, when it has the resources to do so. Responsiveness, though, requires that this time is not in the unreachable distant future but in some limited distance. If the message cannot be processed successfully, another message may signal the error. An error message is not the result we expect, but it is still some response and the system remains responsive with all the benefits it means.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.194.123