Middleware & SOA by Example

SOA main principles: Build systems as set of services where each service is

  • Coarse-grained
  • Interoperable
  • Loosely coupled

A company offers a lot of business services (coarse-grained) developed over many years and exposed to the users (human or other systems) in some form. There are more chances that each of these features have been designed and developed not keeping the above three principles in mind. Moreover, each of those features might be running on disparate heterogeneous platforms, using different technologies etc.

What if you want to integrate these disparate features thus creating new solutions (For e.g. Amazon store front is a new service composed of their catalog service, shopping cart service etc)?

You have two choices:

  1. Building the new feature from scratch keeping the 3 principles in mind. But it is a very costly endeavor, and one that’s almost never successful.
  2. An effective and less risky alternative is to assemble/compose it from existing, proven (well tested) services.

Option 2 is where ESBs can help with their support for routing, transformation, monitoring etc. Apache Camel, Mule are open-source ESB’s. Endpoints & Routes are the terminology used in EIP (Enterprise Integration Patterns) that these ESB’s implement. ESB’s can take help of MOM’s (Message-Oriented-Middleware) when they want to route/integrate services that are running on heterogeneous platforms (For e.g. the catalog service might be running on a mainframe system but the shopping cart is implemented using stateful EJBs running in a Java Application server). Message queue is a concept in MOM that acts a temporary storage of the message between the sender and receiver. This temporary storage provides lot of benefits like asynchronous delivery, guaranteed delivery etc. There are several different MOM vendors like IBM (WebSphere MQ), open-source ActiveMQ etc. We can use JMS to keep your code independent of the vendor.

I tried to relate all the concepts with an example. I also tried to keep it short. Please
ask follow up questions to gain more understanding.

MOM is not a requirement to implement SOA. For e.g. if all of your services are exposed over SOAP via HTTP then you don’t need a MOM in this case.

Leave a Comment