Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

   

During our SAP e-learning course study we came across a very distinct Process pattern called the Sync-Async bridge which is used to integrate synchronous and asynchronous systems using ccBPM tasks. Interconnecting async and synchronous systems is one of the more common situations which we face in any system landscape. One such scenario could be a need to interconnect web based synchronous request response systems like say an HTTP based client system to a legacy application (typical mainframe) which talks asynchronously using File based data transfer. This can be accomplished using the Sync-Async Bridge pattern provided in integration repository. I have demonstrated the features of this pattern using a simple use case which was originally designed to query a stock quote web service. The HTTP requesting application makes a Synchronous request thro' Xi to a File based system which inturn responds asynchronously. XI manages the process chain and provides a synchronous response back to the HTTP client. The request and the response data are logically mapped using correlations in ccBPM.


Use Case:


The intention of this weblog is to demonstrate an typical integration scenario between a synchronous HTTP client and an asynchronous file based legacy application. The standard Sync-Async process pattern is used in this demo.


Request is a typical XML payload asking for a Stock Quote related information.The legacy application is expected to receive the request and post a response back to querying HTTP application asynchronously. Xi uses the ccBPM Sync – Async bridge pattern to manage the message flow, correlates the request and response messages and hook back the asynchronous response from the legacy application as a Synchronous response to HTTP client.


*Legacy Application configuration: *


For this demo to simulate the functionality of a legacy application, I have used a simple freeware called LOGMONITOR which is freely available for download from **+http://www.bitrix.ru/logmon/eng/  . + This application monitors the incoming directory for the request file to be created and once the file is created the XI system, the application moves this request to an Archive folder and simultaneously it also moves an response file to the response folder. This simply simulates what a legacy file based application would do after processing a request message.We have retained the same schema for HTTPClient and legacy system, so no explicit message mappings/interface mappings are necessary in this use case configuration


+Note: Config of the tool is out of scope of this presentation, check the tool help for the same +


+Note: Please note that this response from legacy application has to be sent before pipeline timeout occurs in XI. Else HTTP Client would get a Pipeline timeout response and hence you may have to resend the request again.One can however manage this in ccBPM using WAIT task and using deadline branch so that any delay in response from end systems can be handled. +


*The flow is detailed in the process diagram given *





+Fig 1.1 Process Diagram +


*Client configuration *


Plain HTTP adapter is uses the XI server pipeline URL to directly send the payload to the XI system. We can reuse or develop a script based client which can post a payload along with the set of parameters to pipeline.One can also reuse an HTTP client from one of examples available in SDN for this purpose.


Standard Config params for HTTP Sender adapter needs to be mentioned including the

          Server Host - “pdcntwr.wipro.com”

         Server Port - 50000 ( + HTTP Port) +


                    Client             - 100 (<client number>)

         Sender Service - WEBAPPS

        
QOS - BE(Best Effort)

         Sender Interface - HTTPRequestInt+ (+Outbound Message Interface name)

         Sender Namespace - Interface name space


*Integration Builder - Design *


1) Create the data type/import the XSD representing the payload request-response - *StockQuoteRequest *


       
       

+Fig 1.2 Stock Quote Request-Response Schema +


2) Create the following Message Types



       - HTTPRequestType

       - HTTPResponseType


       Create the Message Interfaces



       
- HTTPRequestInt

        
    Purpose - Sender Interface used by HTTP Client to send payload to Xi

        
    Mode - Outbound Synchronous




       
- HTTPResponseInt


        
   
Purpose - inbound Interface used by File Receiver to send information to legacy application's incoming folder

        
    Mode - Inbound Asynchronous



       
- FileResponsetoBPM

        
   
Purpose - Used to send the Async response information from File system (File sender adapter) to BPM

        
   
Mode - Outbound Asynchronous


3) Interfaces to be used in ccBPM Process



       
- HTTPRequestIntAbstract


        
   
Purpose: To Receive message from HTTP Sender adapter in ccBPM

        
   
Mode : Abstract Sync



       
- HTTPRequestIntAbstractAsync

        
   
Purpose: To send the request XML message to the Outbound Message interface of the File Receiver

        
   
Mode : Abstract Async



       
- HTTPResponseIntAsyncAbstract

        
   
Purpose: To Receive the response XML message from the File Outbound adapter (File sender) in Xi

        
   
Mode : Abstract Async


4) Design of ccBPM Process


We will reuse the standard Sync-Async pattern for the process


*HTTPtoFile_Sync_Async *


The process contains 4 steps to accomplish the Sync- Async scenario


    • SyncReceive – To Receive the payload synchronously from HTTPRequestInt interface

    • syncSend – To Send the request payload Asynchronously from BPM to the File system

    • syncReceive – To receive the response payload Asynchronously from Legacy File system to BPM

    • SyncSend – To Send the response Synchronously from BPM to LegacySystem

The relevant configurations in each of the tasks can be found in the snapshot below


!https://weblogs.sdn.sap.com/weblogs/images/36050/FullSnap.jpg|height=400|alt=image|width=531|src=htt...!


+Fig 1.3 Sync-Async BPM Process definition in Repository +

A Correlation “QuoteName” is defined to link the Stock information in the request and the response messages so that ccBPM can map the correct stock quote for which the response is sent back by the legacy application.


A snapshot of this correlation definition is shown below.


!https://weblogs.sdn.sap.com/weblogs/images/36050/correlation.jpg|height=376|alt=image|width=600|src=...


+Fig 1.4 Correlation definition for the request and response structures +


*Integration Builder – Configurations *


Create a Business Service “TestFiler” and Configure the File adapter communication channels to receive and send the payload from Legacy application back to the ccBPM process.


We have configured 2 channels



       
File_Receiver – Inbound adapter to receive data from Xi system to create XML files in the Legacy application's incoming directory


       
File_Sender – Outbound adapter to Send files from Legacy Appln to the Xi systems as a Xi-SOAP message


Also configure the following Receiver Determinations


Ø HTTP Client (Sender) – BPM Process (Receiver)


       
Sender Service : TestFiler


       
Sender Interface: HTTPRequestInt


       
Receiver Service : HTTPSyncAsyncProcess


       
Receiver interface: HTTPRequestIntAbstract


Ø BPM Async Send Request(Sender) – File Receiver (Request)


       
Sender Service : HTTPSyncAsyncProcess


       
Sender Interface: HTTPRequestIntAbstractAsync


       
Receive Service : TestFiler


       
Receiver interface: HTTPRequestIntAbstract


       
Receiver Agreement: File Receiver channel


Ø File Sender (Response Sender)- BPM Async Receive Response


       
Sender Service : TestFiler


       
Sender Interface: FileResponsetoBPM


       
Receive Service : HTTPSyncAsyncProcess


       
Receiver interface: HTTPResponseIntAsyncAbstract


       
Sender Agreement: File Sender channel


*Finally Test the Entire process: *


Once the configuration is complete , we can test the interface by using a XML Payload as


Input.The ccBPM will receive the message from the pipeline and asynchronously send the message to File_Receiver inbound adapter, which will convert the file back to XML and place it in the “incoming” folder of legacy app.


The Logmon tool will immediately move the created file to an archive folder and triggers an action which will place a response XML in the “outgoing” folder.The File_Sender outgoing adapter picks up this file and sends it across to the XI system asynchronously.After correlating the stock Quote_Name from the response with request, ccBPM will route the response to corresponding process instance.


The response obtained in the HTTP Client will look as per snapshot below .. **


!https://weblogs.sdn.sap.com/weblogs/images/36050/Result.jpg|height=400|alt=image|width=563|src=https...!

+Fig 1.5 Response snapshot of HTTP Response +


*Conclusion: *The above Use case illustrates how we can integrate Sync and Asynchronous systems using the ccBPM Sync-Async bridge.The scenario can be enhance with data conversion and message transformations between the systems as would happen in a live scenario.

    


15 Comments