PUB/SUB Taken To Next Level Enterprise Event Bus (EEB)

Aliases

Publisher-Subscriber, pub-sub, Enterprise Event Bus, EEB, Notification Broker

Context

You have distributed applications (from different vendors running on variety of platforms) , integrated with middleware infrastructure. Applications interact with each other in a traditional/synchronous way by sending messages over the Enterprise Service Bus (ESB)/Broker to get the job done.

Problem

The synchronous infrastructure is causing delays leading to unproductive wait times and dissatisfaction from the users.  There is a need for applications to propagate information (State changes, Interesting events) to other interested applications asynchronously without knowing the details about their identity?

Forces

Following are driving forces behind Enterprise Event Bus (EEB)

  • Applications (publishers/subscribers) can be dynamically added/removed from the EEB.
  • Applications should be able to publish various Events.
  • Applications should be able to consume various Events for which it is interested, Should not receive other events.
  • EEB should support the following
    • Store and Forward:
    • Throttling:
    • Translation:
    • Filtering:
    • Push and Pull:
  • Various Protocol :
  • Governance and Monitoring:

Solution

Enhance the existing middleware infrastructure to allow registering/deregistering publisher/subscriber, devise a mechanism to send the event (notification) to intended listeners with the help of topics. One of the two WS-* specifications (WS-Notification: Spearheaded by IBM, WS-Eventing: Spearheaded by Microsoft) may be considered while implementing the approach.  We will useJBoss Fuse Services works to implement this approach.

Architecture

Design is pretty simple, we have got set of components (services and processes) to provide functionality, exposed over various bindings, data store (Relational and column oriented) to store the configuration and eventing data, and mechanism (In this case Apache Camel) to route/translate events.

Level 0 

Level 1

Level 2

 Here is the ER diagram to start with. With this setup store and forward can be implemented easily.

Why JBoss Fuse Service Works?

  • Exposing any end point (SOAP, REST, JMS AMQP, etc.) is just a matter of few clicks.
  • Monitoring and Governance support
  • Built in support to integrate with BPMN, Drools and Camel.
  • Can be deployed to OSGI as well as server
  • JEE support
  • I wanted to try something different 🙂

Example

A mini EEB using Fuse Service works for demonstration purpose can be cloned from GitHub, instructions to bring it up and running is provided in the README.md file.

Here is the switchyard diagram for the Notification feature. It hardly took me any time to implement this feature, same can be extended further to provide other features easily.

Resulting Context

When considering this approach following benefits and liabilities should be evaluated.

Benefits

  • Supports the business demands for better service
  • Highly decoupled applications with more flexible and agile structure
  • Highly Secured

Liabilities

  • Increased maintenance
  • Decreased performance

Conclusion

EEB can help enterprise build highly decoupled, flexible, secured and event driven applications.

References