I was wondering if there is a clear distinction between message driven and event driven environments when we refer to SOA or middleware and generally in cases of application and enterprise integration. I understand that a user interface resembles an event driven model where our system intercepts action by the user.
Also it is clear that messaging supports systems based on publish/subscribe, sychronous or asynchronous communication, transactions etc.
But is there a difference in the middleware/soa/application intergration context? (architecture level). I am trying to consult sources such wikipedia (here, and here), but I am still somewhat confused. When should a developer prefer one solution over the other?
Are there examples or cases where one approach makes more sense than the other? Or any comprehensive resources and guides to implementing each one?
Many thanks for any insight.
The difference between events and messages is that events are used for intra-stack communication, whereas messages are used for inter-stack communication.
Message-driven processing is a technique used in a client-server environment in which a client requests a service from a server-side application via a message broker. The message broker then sends the request to the corresponding application.
An event-driven architecture uses events to trigger and communicate between decoupled services and is common in modern applications built with microservices. An event is a change in state, or an update, like an item being placed in a shopping cart on an e-commerce website.
In request-response architecture, an application's components communicate via API calls. The client sends a request and expects a response before performing the next task. In event-driven architecture, the client generates an event and can immediately move on to its next task.
Here is a Typesafe/Reactive point of view on the question from Jonas Bonér. From the third paragraph of this blog post:
The difference being that messages are directed, events are not — a message has a clear addressable recipient while an event just happen for others (0-N) to observe it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With