WebSphere

Stock quote scenario: flexibility and reuse

How to use adjust the service connectivity logic of the stock quote scenario, to make the solution more flexible.

Introduction

A mediation flow encapsulates service connectivity logic, that is invoked when a message is received by the ESB. A mediation flow helps you to reuse existing services and applications.

Stock quote version 1.0

Initially, the financial services company that provides the stock quotes has a business requirement for two levels of service: premium and standard. In addition, the business has only two Web services that can provide the relevant business services. Therefore, version 1.0 of the stock quote mediation flow assumes that there will be only two service endpoints, and that the endpoint addresses are known when the mediation flow is created. The flow is dynamic in the sense that the precise service endpoint is selected at runtime, based upon the customer subscription level. However, the flow could be made more dynamic, and more flexible, by removing the service addresses from the mediation flow and storing them elsewhere.

The following image shows version 1.0 of the stock quote scenario. The mediation flow logs the input message for audit purposes, looks up the customer subscription level in a database, routes the message based upon the subscription level, and transforms the message format to make it suitable for the service provider.
Figure 1. Mediation flow for stock quote version 1.0
Mediation flow for stock quote version 1.0

Stock quote version 1.1: increasing flexibility and reuse

As the financial services company grows it finds that it has a requirement for greater flexibility, and wants to make use of new Web services as they become available, without deploying modules to the runtime. By storing service endpoint addresses in a database, the administrator can manage the use of Web services by making changes to one database, rather than having to redeploy a changed EAR file, perhaps to multiple machines.

The following image shows version 1.1 of the stock quote scenario. The first mediation primitive looks up the customer subscription level in a database and passes the subscription level to the next mediation primitive, which uses the subscription level to look up the service address. The message is then passed on to another mediation primitive which logs it, for audit purposes. Finally, a mediation primitive transforms the message format, to make the message suitable for the service provider. The image shows an import, which is used to provide a default endpoint, in case the registry fails to return a dynamic endpoint.
Figure 2. Mediation flow for stock quote version 1.1: improved flexibility
Mediation flow for stock quote version 1.1

Stock quote version 1.2: further flexibility and reuse

Over a period of time the financial services company finds it has a business requirement to use services from other companies, so that it can cater for particular geographical or linguistic areas. The financial services company, therefore, decides to store all the service endpoint addresses it uses in a registry. The mediation flow can then extract the service that is most suitable for the customer. This requires adding service endpoint details to a registry, and setting up a query of the registry from the mediation flow, (using the Endpoint Lookup mediation primitive).

The following image shows version 1.2 of the stock quote scenario. The first mediation primitive looks up the customer subscription level in a database and passes the subscription level to the next mediation primitive, which uses the subscription level, and customer location, to look up the most suitable service in a registry. The message is then passed on to another mediation primitive which logs it, for audit purposes. Finally, a mediation primitive transforms the message format, to make the message suitable for the service provider. The image shows an import, which is used to provide a default endpoint, in case the registry fails to return a dynamic endpoint.
Figure 3. Mediation flow for stock quote version 1.2: improved flexibility and reuse
Mediation flow for stock quote version 1.2

concept Concept topic

Terms of use | Feedback


Timestamp icon Last updated: 20 June 2010 00:38:45 BST (DRAFT)


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wbpm.scenarios.esb1.620.doc/concepts/cwesb_stockquotemediationflows.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).
iDoc on