+

Search Tips   |   Advanced Search

Datapower integration with WebSphere Application Server



Overview

The DataPower XI50 Integration Appliance delivers

  • Accelerator functions
  • Security functions
  • Enterprise service bus
  • Data enablement
  • Web services management

The DataPower XC10 Appliance enables...

  • Hardened security at the distributed caching tier (240GB cache)
  • Business applications to process billions of transactions per day with near-linear scalability.

The DataPower XC10 V2 REST Gateway integrates the elastic caching tier as a side cache for the Enterprise Service Bus (ESB). A data grid hosted on the DataPower XC10 functions as a SOA results cache for the DataPower XI50 ESB. In a SOA, all application requests pass through the ESB before they are routed to the application. Therefore, if the result of an application request is retrieved from the elastic caching tier, the application processing latency for that request is eliminated, significantly speeding up the response time.

This article implements a banking scenario where customers send requests with...

  • Bank account number
  • IFSC code

As incoming client application requests are received, the multi-protocol gateway (MPG) service configured on the DataPower XI50 schema...

  • Validates the request message
  • Uses the REST-based HTTP GET method to check whether the request is cached in the data grid

If the HTTP GET returns an...

HTTP 404 Not found

...indicating a cache miss, the MPG allows the request to pass through to the existing processing flow to the application hosted on the back-end system. The MPG then caches the response as it flows back through the MPG to the client application. The MPG uses the REST-based HTTP POST method to insert the response into the side cache. If the incoming request is found in the cache, then the result is retrieved from the cache, bypassing the back-end system, thus removing the latency introduced by the application and data layers.


REST configuration files

DataPower XC10 and XI50 integration is achieved using the REST interfaces provided by DataPower XC10 xsl configuration files.

cache-config.xml
  • Name of the data grid to be used for caching
  • Data that needs to be cached
  • connection details for the DataPower XC10
  • cache-get.xsl Used find if there is cache hit
    cache-set.xsl Set the data in the cache during a cache miss


    Monitor the data grid in the DataPower XC10

    To view data grid usage, from the DataPower XC10 console...

    Monitor tab | Individual Data grid


    Procedure

    1. Download sample files

    2. Unzip download.zip...

      unzip download.zip
      Archive:  download.zip
         creating: Artifacts/
        inflating: Artifacts/BankUserDetails.xml
        inflating: Artifacts/cache-config.xml
        inflating: Artifacts/cache-get.xsl
        inflating: Artifacts/cache-set.xsl
        inflating: Artifacts/cache-util.xsl
        inflating: Artifacts/DPBankService.war
        inflating: Artifacts/DPBankServiceService.wsdl
        inflating: Artifacts/DPBankServiceService_schema1.xsd
         creating: Artifacts/Figures/
        inflating: Artifacts/Figures/fig01.gif
       extracting: Artifacts/Figures/fig02.gif
        inflating: Artifacts/Figures/fig03.gif
        inflating: Artifacts/Figures/fig04.gif
        inflating: Artifacts/Figures/fig05.gif
        inflating: Artifacts/Figures/fig06.gif
        inflating: Artifacts/Figures/fig07.GIF
        inflating: Artifacts/Figures/fig08.GIF
        inflating: Artifacts/Figures/fig09.gif
       extracting: Artifacts/Figures/fig10.GIF
        inflating: Artifacts/Figures/fig11.gif
       extracting: Artifacts/Figures/fig12.gif
        inflating: Artifacts/Figures/fig13.gif
        inflating: Artifacts/Figures/fig14.gif
        inflating: Artifacts/Figures/fig15.gif
        inflating: Artifacts/Figures/fig16.gif
        inflating: Artifacts/Figures/fig17.gif
        inflating: Artifacts/Figures/fig18.gif
       extracting: Artifacts/Figures/fig19.gif
        inflating: Artifacts/SQLCommands.txt
      

    3. Deploy DPBankService.war

    4. Create datasource BANKDB

    5. Create a database and bank user details table by executing SQLCommands.txt

      When a bank customer sends a request to fetch the user details, they will be fetched from this table and then cached in the data grid of the XC10.

    6. From the XC10 create a new data grid for caching the response data for the service...

      Data Grid tab | Simple Data Grid | +

    7. Log on to the DataPower XI50 console...

    8. Go to...

      File Management | Upload files

      ...and upload...

    9. In the DataPower XI50 console panel, click on the Multi-Protocol Gateway and create: BankMPG

      Keep the Type as static-backend.

    10. For Propagate URI, select Off, and for all other settings, accept the defaults

    11. Enter the back-end URL, found in WSDL file, where the Web service will be deployed on WebSphere Application Server.

      http://myhost.foobar.com:9080/DPBankService/DPBankServiceService

    12. Click on + in the Front Side Protocol Settings section select...

      HTTP Front Side Handler

    13. Enter the name of this Front Side Protocol as: BankingFSH. Accept all of the defaults and change the port number to any number, such as 4444

    14. Click the Eclipse tab against the Multi Protocol Gate policy section and a Policy Editor will open.

    15. Under the Policy section, enter the policy name as: Banking policy. Under the Rule section, click on the New Rule button. A default rule name will appear, which you can leave as-is or change as you wish. Set the Rule Direction to...

      Client to Server

      ...as you will configure this rule for incoming request messages.

    16. A policy defines how a service handles each request and response that arrives. In the middle portion of the Policy Editor is a processing rule, often referred to as a processing pipeline. The rule is read from left to right, and each action (represented by various icons) executes against the inbound message. By default, this processing policy has a Match action

    17. The yellow box around the action means that it still needs to be configured. Configure the Match action to inspect the inbound message and determine whether it matches. In this scenario, the Match action matches any URL that arrives into the service, so set URL pattern: *.

    18. Double-click on the Match action and in the window...

      Configure a Match Action

      ...click on the Plus (+) icon against the Matching Rule field...

    19. A new window opens. Enter the name of this Match action: MatchAll.

    20. Click on the Matching Rule tab...

    21. From the Matching Rule panel, click Add and enter the URL Match as: *

    22. Click Apply. The window closes and the rule appears in the previous window. Click Apply to close this window and then click Done

    23. For schema validation, drag and drop the Validate action from the Rule Pallet and then double-click.

      Since we will validate incoming request xml with WSDL, click...

      Validate Document via WSDL URL

      ...and then select the WSDL file...

      DPBankServiceService.wsdl

    24. To store the data fetched from the back end in the XC10 cache data grid, drag and drop a Transform action on the Processing Policy rule bar after the Validate action.

      Double-click to configure. Accept all of the defaults, select cache-set.xsl, and then click Done:

    25. To set details regarding the outbound message and where to forward, drag the Results action from the Action Pallet to the Processing Rule bar.

    26. Click on the New Rule button and accept the default name. Select the Rule Direction as...

      Server to Client

      A new rule bar will appear with the default Match action. Double-click on the Match action to configure it. On the Configure Match action window, select the previously created MatchAll rule from the drop-down.

    27. Drag and drop the Transform action from the Action Pallet on the Response Rule Bar and double-click to configure it.

      Select cache-get.xsl, and then click Done. Drag and drop the Results action on the Response Rule Bar...

    28. Test the configuration by executing the following curl request...

      post BankUserDetails.xml http://datapowerIP:4444

      which sends two parameters...

      • IFSC Code
      • Account Number

      ...to the DPBankService Web service, which should fetch the user details from the back-end Web service, which in turn fetches the details from the database.

    29. You can monitor the usage of bankacc data grid in the XC10 console...

      Monitor tab | Individual Data grid | bankacc

     

    See

    Integrate WebSphere DataPower XC10 and XI50 Appliances