Event-driven Messaging
   HOME

TheInfoList



OR:

The event-driven messaging is a design pattern, applied within the service-orientation
design paradigm A design is a plan or specification for the construction of an object or system or for the implementation of an activity or process or the result of that plan or specification in the form of a prototype, product, or process. The verb ''to design'' ...
to enable the service consumers, which are interested in events that occur within the periphery of a service provider, to get notifications about these events as and when they occur without resorting to the traditional inefficient polling based mechanism.Wajid Khattak, Vijay Narayana
Event-Driven Messaging
Online].Date accessed: 27 April 2010.


Rationale

The interaction between a service consumer and a service provider is normally initiated by the service consumer as it needs to respond to an event that occurs within the boundary of the service consumer itself e.g. requiring some data from an external resource (i.e. the service provider) in order to perform a calculation whose results need to be relayed back to a
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine f ...
in response to an action performed by the user. However, there are situations where the service consumer needs to wait for the occurrence of an event within the boundary of the service provider itself. Under these circumstances, the service consumer somehow needs to be informed of the event as and when it happens. One way is to program the service consumer to poll the service provider with regular intervals so that it can check if the event happened or not. This approach not only manifests inefficiency but also behavioral unpredictability. Inefficiency because the service consumer and the service provider are engaged in unproductive interactions and unreliable because it might be that the event actually happened more than once before the service consumer could poll the service provider, thereby missing the previous events and their related data. Apart from these problems, such a technique also introduces latency as the interval with which the service consumer performs the polling is fixed and, therefore, it would only fetch the event data at that time and not when the event actually occurred. This whole scenario deteriorates even further if multiple service consumers are dependent on a particular service provider. In order to tackle this problem, the event-driven messaging design pattern suggests a publisher-subscriber communication mechanism that ensures timely notification of event related data to the service consumer,Mauro. et al
Service Oriented Device Integration – An Analysis of SOA Design Patterns.
nline pp.1–10, 2010 43rd Hawaii International Conference on System Sciences, 2010. Date accessed: 4 April 2010.
thereby eliminating the inefficiencies linked with the traditional polling based communication mechanism.


Usage

The application of the event-driven messaging design pattern requires an event manager with whom the service provider registers its events. The service consumers then register their interest in few or all of the advertised events. Upon the occurrence of an event, the service provider informs the event manager that then notifies all of the registered service consumers instantly.Mauro et al
Standardized Device Services – A Design Pattern for Service Oriented Integration of Medical Devices
nlineDate accessed: 4 April 2010.
This communication mechanism shares its roots with the Observer pattern applied traditionally within the
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of pro ...
world. This design pattern also borrows some concepts from the Event-Driven Architecture as the fundamental rationale behind this design pattern is responding to events.
Thomas Erl Thomas Erl (born 1967) is a Canadian author, and public speaker known for major contributions to the field of service-oriented architecture. Author of eight books on Service Orientation, Erl defined eight widely accepted principles of service ...
br>Introducing SOA Design Patterns
Online].Date accessed: 4 April 2010.
The actual implementation of such a publisher–subscriber-based communication mechanism requires architectural extensions in order to provide such a complex message tracking and forwarding mechanism. A mature Enterprise service bus, ESB product should normally be able to provide such functionality. The application of this pattern helps to further decouple Coupling Types the service consumers from the service providers and increases the overall reliability of a service composition.


References

* Erl et al.,(2009
SOA Design Patterns
Prentice Hall. {{ISBN, 0-13-613516-1. * Michael Sta
Using Architectural Patterns and Blueprints for Service-Oriented Architecture
Online].Date accessed: 1 May 2010.


External links


SOA Patterns
Service-oriented (business computing)