Skip to main content

How to make Async Service as Sync Service in OSB 11G

Recently i came across with a requirement where i need to design an OSB proxy layer to invoke.

Most of the time we don't have a requirement where we need to make Async Service as Sync Service, After all it will finish the purpose of Async Service, but there can be a case, Where end user don't want to implement a callback URL on his level, then developer need to put more efforts to make in behave as Sync.

Here i am not going to design complete project from scratch, But focusing on key points by which we can achieve it.

See above image, With such implementation we can achieve it.

  1. Create three proxy services:
    1. Proxy 1, Exposed to end user, where user will send request data and unique message id, This proxy service will invoke main method of Async service and send message id which is send from user in the request.
    2. Proxy 2, This service will be a local proxy service and will not be exposed to end user, Proxy 2 URL will be send in Proxy 1 in WS-Addressing headers in return URL or callback URL.
    3. Proxy 3, Exposed to end user, Where user will send unique message id in request, and this service will return response based on message id to user.
  2. How these all proxy will communicate with each other and how they will return response to end user, which is our final aim.
Proxy 1:
  1. Send all request data by end client.
  2. Send a unique message id in request parameter by end client.
  3. In Ws-Addressing, Configure message id and configure callback/return url which is proxy 2 URL.
  4. Proxy 1 will call End service.
  5. When end service will finis with his activities, it will make a callback to URL which is provided in 3rd step.
  6. When callback URL will be called, Proxy 2 will be invoked.
Proxy 2:
  1. Callback URL is executed from proxy 1, Step 5.
  2. This is a XML based service, not the SOAP Service, In case you are using SOA-Direct it will be a SB type and so on.
  3. Callback URL will invoked, and proxy 2 message flow will be executed.
  4. A JMS queue will be designed and business service configured for same.
  5. Invoke JMS queue business service from message flow.
  6. Insert Callback XML response in JMS queue.
Proxy 3:
  1. End user will send a unique message ID, which was send at the time of proxy 1 invocation.
  2. Proxy 3 message flow will executed.
  3. Proxy will invoke JMS queue business service, Which will select JMS queue message from message ID, Send in step 1.
  4. Based on message ID, end user will receive message from queue.
This is a high level implementation of Async Service, In place of JMS queus, We can use data base tables, File, MQ and other adaptors where storage facility is available.

If you have any query, Please comment down.

If you like it please share with others.





Comments

Post a Comment

Popular posts from this blog

Oracle SOA 12C rest adapter with Custom HTTP headers

Most existing web applications are connected through web services, which are commonly known as SOAP services. More and more users are relying on mobile devices for communication, and they’re looking for lighter ways to access enterprise information on the go. REST services are the answer for the mobile device platform, because they get rapid responses and fast access to data. Oracle SOA Suite 12 c  provides a complete set of service infrastructure components for designing, deploying, and managing composite applications. Oracle SOA Suite 12 c  enables services to be created, managed, and orchestrated into composite applications and business processes. Some time we have need to send HTTP headers in REST service, In OSB we use header component and add what ever is needed but in oracle SOA 12C it's little bit different. Let see how we can do it. Create one SOA Application. Create one SOA Sample project inside SOA Application. Go to composite and drag drop REST ...

Solution for BPM standard dashboard & activity guide not working in Oracle SOA 12.2.1.0 C

As earlier i publish a post about different issue of Oracle BPM, After some oracle support i got to fixed them. Issue Blog Here... Issue 3:BPM 12.2.1 process workspace activity guide not working. if you have a normal BPM Process, then this is the issue. In order to have data populated in "Activity Guide" firstly you should create a BPMN Guided Business Process. Below you can find the documentation about activity guide and how to create a Guided Business Process: https://docs.oracle.com/middleware/1221/bpm/bpm-develop/GUID-F765955D-90A5-48D4-8D2A-2F01FBB539E3.htm#BPMPD901 And here is specified: " A Guided Business Process is modeled as an activity guide that is based on a business process. The Activity Guide includes a set of Milestones. A milestone is a contained set of tasks that the end user has to complete. A milestone is complete when the user successfully runs a specific set of tasks in the milestone. " And in the below chapters you will find the ...

Swagger API document from Any WADL & Schema in Oracle SOA

Hi everyone, Hope everyone is doing well these days, Recently i started a project work over how to generate swagger API document for your any REST API, In case if you don't know what is swagger please go and check " https://swagger.io/tools/swagger-editor/ ". It's a great and easy to use tool which will help to create user friendly, human readable form API documentation with extension for generating API client in different languages with capability of testing your API from same. What is swagger editor, Design, describe, and document your API on the first open source editor fully dedicated to OpenAPI-based APIs. The Swagger Editor is great for quickly getting started with the OpenAPI (formerly known as the Swagger Specification) specification, with support for Swagger 2.0 and OpenAPI 3.0.  What benefits you will get by using swagger, Runs Anywhere, The Editor works in any development environment, be it locally or in the web. Smart Feedback, Validate you...