Managing an SOA environment with WebSphere ESB and Tivoli Composite Application Manager for SOA

This article uses a stock quotation service example to describe a typical SOA management challenge and a solution based on WebSphere ESB and ITCAM for SOA.

Share:

Liang Han (hanliang@cn.ibm.com), Software Engineer, ITCAM for SOA, IBM China Development Lab, IBM

Liang Han is a software engineer at IBM China Development Lab in Beijing. He works on the ITCAM for SOA Level 3 Support Team. You can contact Liang at hanliang@cn.ibm.com.



Peng Gao (gpeng@cn.ibm.com), Software Engineer, ITCAM for SOA, IBM China Development Lab, IBM

Peng Gao is a software engineer at IBM China Development Lab in Beijing. He works on the ITCAM for SOA Development Team. You can contact Peng at gpeng@cn.ibm.com.



13 August 2008

Introduction

Service Oriented Architecture (SOA) is increasingly important in software integration, and IBM® middleware such as WebSphere® Application Server, WebSphere Enterprise Service Bus (hereafter called WebSphere ESB), and WebSphere Process Server provide a solid basis for SOA architectures and applications. In addition, IBM Tivoli® Composite Application Manager for SOA (hereafter called ITCAM for SOA) provides powerful monitoring, controlling, and discovery features for SOA. This article describes a typical SOA management challenge and a solution based on WebSphere ESB and ITCAM for SOA.

Scenario

A financial services company provides an interactive Web-based stock market service. The company wants to offer a high-quality stock quote service to premium (subscription) customers, and an intermittent quote service to standard customers during high-volume periods, as described below:

  • When service performance is good, offer the real-time stock quote services to all customers
  • When service performance drops below a predefined threshold during high-volume periods, offer the real-time stock quote services to premium customers only, and reject requests from standard customers.

This case presents these requirements:

  • Create configurable runtime mediation to determine whether to accept or reject requests
  • Monitor performance of back-end stock quote service
  • When performance is degraded, take action to automatically modify mediation flow

Combining WebSphere ESB and ITCAM for an SOA solution

WebSphere ESB and ITCAM for SOA can meet these three requirements as follows:

  • WebSphere ESB SCA mediation module and primitives provide flexible mediation, allowing configuration of routing rules.
  • Managed SCA mediation primitives from ITCAM for SOA provide runtime configuration, while keeping all the features of the original SCA mediation primitives. ITCAM for SOA managed SCA mediation primitives are building blocks for the WebSphere ESB mediation module, which makes runtime decisions to accept or reject requests.
  • ITCAM for SOA provides real-time performance monitoring of Web services on various application servers, including WebSphere (base and Community Edition), Microsoft® .NET®, SAP, JBoss, BEA WebLogic, and the AXIS SOAP engine in WebLogic.
  • IBM Tivoli Monitoring, the framework on which ITCAM for SOA is built, provides policy function and a workflow editor

Here is the solution architecture:

Figure 1. Solution architecture
Figure 1

The mediation service that runs on WebSphere ESB is contained in a single mediation module, which consists of an export (SQService) that provides an interface for the requester, an import (RealtimeService) that binds to the external service providers, and a mediation flow component (SQMediation) that defines the mediation implementation. For information on how to create the mediation flow, see the WebSphere Integration Developer information center.

Figure 2. SCA mediation components
Figure 2

To perform the steps in this article, you need to configure the environment as shown below. For more information on any of these products, see Resources at the bottom of the article.

  1. Install WebSphere ESB V6 or WebSphere Process Server V6.
  2. Install WebSphere Integration Developer V6.
  3. Install Tivoli Monitoring V6.1 FixPack 4 or later.
  4. Install ITCAM for SOA V6.1 or later, including the mediation support tool.
  5. Although ITCAM for SOA can monitor many application servers, this example uses the WebSphere Application Server instance installed as part of WebSphere ESB.

Creating mediation with managed SCA mediation primitives

ITCAM for SOA managed SCA mediation primitives, delivered as an Eclipse plug-in, provide runtime configuration capability while keeping all features of the original WebSphere ESB SCA mediation primitives. The managed SCA mediation primitives are building blocks for the SCA mediation module. You need to install ITCAM for SOA managed SCA mediation primitives to WebSphere Integration Developer, and perform the following steps to create the mediation module to make the runtime decision to accept or reject requests:

Install ITCAM for SOA managed SCA mediation primitives

Install ITCAM for SOA managed SCA mediation primitives to WebSphere Integration Developer following the ITCAM for SOA Tools guide. If the managed SCA mediation primitives are installed successfully, you will find the icons in the red circle in the palette as shown below:

Figure 3: Managed SCA mediation primitives
Figure 3

Create Stock Quote Library, which defines the interfaces

  1. Create a library project named Resources.
  2. Get the WSDL file from the Download .zip file.
  3. Create the StockQuote mediation interface for export:
    1. Create the business objects SQRequest and SQResponse:
      SQRequest attributes:
         name: symbol              type:string
         name: customerID          type:string
      SQResponse attribute:
         name: value               type:float
    2. Create the Interface SQService as the export interface:
      SQService operation:
         Operation name:           getQuote
            Input(s):              name: request       type:SQRequest
            Output(s):             name: response      type:SQResponse

Create StockQuote SCA mediation module based on Resource Library

  1. 1 Create an SCA mediation module project named StockQuote and select Resource as the Required Library.
  2. 2 Create a mediation module with components as shown in Figure 2 above.
  3. 3 Generate Web service binding for SQService using SOAP/HTTP as the transport protocol. Port name is SQService_SQServiceHttpPort.
  4. 4 Implement the routing rule in SQMediation.
    1. a Implement request flow as shown below:
      Figure 4. Request flow
      Figure 4

      Implement the switch logic in manager SCA mediation primitive, as shown below. In this example, assume CustomerA is a standard customer and CustomerB is a premium customer. When the request is from CustomerA (standard customer), the message is routed to Busy primitive and then rejected with a message. The Managed Message Filter: Manager looks like this:

      Distribution mode:  First 
      Pattern:            /body/getQuote/request/customerID[self::node()= CustomerA
      Terminal name:      busy

      Then implement the message transformation logic in the Adapter primitive as shown below. This transformation is to tailor the messages to match the back-end service interface.

      Figure 5. Request message transformation
      Figure 5

      Then implement the Busy primitive by setting the Error Message to Server as too busy to respond.

    2. b Implement the response flow to transform the message to match the front-end service interface.
  5. 5 Export the StockQuote mediation module into an EAR file and deploy it in WebSphere ESB.

Enabling performance monitoring with ITCAM for SOA

ITCAM for SOA puts a data collector into the WebSphere environment to collect transaction performance data, summarize it, and present it in Tivoli Enterprise Portal in charts format. To enable Web services monitoring, do the following steps:

  1. 1 Make sure the front-end browser application and the back-end real-time stock quote Web service are installed correctly.
  2. 2 Stop WebSphere ESB.
  3. 3 Enable the ITCAM for SOA data collector on WebSphere ESB with commands similar to these:
       C:\IBM\ITM\tmaitm6\KD4\bin\KD4configDC.bat -Cenable -Cenv 1 C:\IBM\WESB602
       C:\IBM\ITM\tmaitm6\KD4\bin\KD4configDC.bat -Cenable -Cenv 9 C:\IBM\WESB602
  4. 4 Run some Web service traffic using URL: http://localhost:9080/StockQuoteSample/StockQuoteServlet:
    Figure 6. Sample application Web page
    Figure 6
  5. 5 After a few minutes, refresh the page, and you should see performance data on Tivoli Enterprise Portal:
    Figure 7. Performance data on TEP
    Figure 7

The upper left panel is the navigator tree. When you click the Performance Summary node, you see the Average Response Time by Operation view on the upper right, and the Service Inventory view on the button panel. The Service Inventory view shows the services discovered by ITCAM for SOA, with their detailed static information and latest status. Average Response Time by Operation shows the average response time in the last collection period (normally, ITCAM for SOA collects data every 5 minutes). You can see in Figure 7 that four pairs of services with the same operation name (getQuote) have been discovered. The first two pairs are SCA components; the third pair is the interface exported by the mediation module; and the last one (RealtimeServiceSOAP) is the real back-end service.

Creating policy with IBM Tivoli monitoring

You should understand the following concepts regarding Tivoli monitoring:

  • Situation -- A defined set of conditions and actions that the Tivoli Monitoring agent has been configured to recognize and respond to (Take Action). A situation can be a simple monitor threshold with associated threshold values, or a more complex Boolean formula.
  • Take Action -- To create and send commands to systems in your managed enterprise.
  • Policy -- A set of instructions that lets you implement complex workflow strategies to incorporate advanced automation into your monitoring environment. Policies are designed, accessed, displayed, and created in the graphical Workflow Editor.

For more information, see Resources at the bottom of the article.

Create situations to evaluate the performance status

To view and modify this situation, open the Situation Editor: right-click the Performance Summary node and select Situations. You need to create two new situations as shown below: SQResponseTimeCritical (StockQuote back-end service performance is bad) and SQResponseTimeGood (StockQuote back-end service performance is good). To learn how to create a Situation, see the Tivoli Monitoring information center. After that, you need to associate and start the situation: right-click the ResponseTimeCritical_610 node, and select Associate / Start Situation.

  • Situation SQResponseTimeCritical Formula:
    (Average Elapsed Message Round Trip Time > 5000 AND Interval Status == Complete
    AND Operation Name (Unicode) == 'getQuote' AND Service Port Name (Unicode) ==
    'RealtimeServiceSOAP' AND Service Type == Requester)
  • Situation SQResponseTimeGood Formula:
    (Average Elapsed Message Round Trip Time <= 5000 AND Interval Status == Complete
    AND Operation Name (Unicode) == 'getQuote' AND Service Port Name (Unicode) ==
    'RealtimeServiceSOAP' AND Service Type == Requester)

Using Take Action to enable or disable the filter mediation

ITCAM for SOA provides ConfigureMediation_610 Take Action to enable or disable mediation. To run ConfigureMediation_610, go to the Mediation Configuration workspace, right-click, and select Take Action in the popup menu. Then select ConfigurationMediation_610 and fill in the blank spaces with the following attribute values. You can enable or disable mediation by setting Enabled=True or Enabled=False.

Figure 8. Take action -- ConfigurationMediation_610
Figure 8

Create a policy to enable mediation automatically when performance is below a predefined threshold

  1. Click the Workflow Editor icon on the toolbar to open the Workflow Editor.
  2. Create a new workflow such that:

    When SQResponseTimeCritial is true, then run TakeAction. . .

    (D4: kd4cm "Service_Component_Architecture,tive40:9443,StockQuoteApp:StockQuote:
    SQMediation,ManagedMessageFilter,Manager,Enabled=True")

    . . . to enable the filter mediation.

    When SQResponseTimeGood is true, then run TakeAction. . .

    (D4: kd4cm "Service_Component_Architecture,tive40:9443,StockQuoteApp:StockQuote:
    SQMediation,ManagedMessageFilter,Manager,Enabled=False")

    . . . to disable the filter mediation

  3. After creating this policy, distribute it to the correct environment and start it.:
    Figure 9. Workflow -- SQPerformance
    Figure 9

Testing the solution

A configuration file (C:\tmp\SQConfig.properties) is provided to configure the delay time of the back-end StockQuote service. You can modify the delay time to 6 seconds (DelayTime=6), which means that according to the policy, the SQResponseTimeCritical is fired, and the mediation is enabled. You can specify that Customer A (standard customer) cannot access stock price quotes, while Customer B (premium customer) can still use the service. If you change the DelayTime to a small number or just comment out the setting by adding # at the beginning of the line, then after invoking the service several times, SQResponseTimeGood is fired and the mediation is disabled.

Moving forward, you can create policy based on situations provided by other ITM agents and user-defined Actions.

  • For example, when CPU use is too high, requests from standard customers are rejected:
    Sample Situations provided by ITM operating system agent
    Situation C NT_Process_CPU_Critical Formula:
    (% Processor Time >= 90 AND ID Process == 3100)
  • Another example is when performance is under a predefined threshold, you can send a message to the administrator's laptop:
    Sample user defined Actions 
    "net send machine1 BadPerformance'

Conclusion

This article described an SOA solution based on WebSphere ESB and ITCAM for SOA, and showed you how to configure it.


Download

DescriptionNameSize
Code sampleSQSample.zip170 KB

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere, Tivoli (service management), Tivoli
ArticleID=330463
ArticleTitle=Managing an SOA environment with WebSphere ESB and Tivoli Composite Application Manager for SOA
publish-date=08132008