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.
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.
- Create three proxy services:
- 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.
- 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.
- 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.
- 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:
- Send all request data by end client.
- Send a unique message id in request parameter by end client.
- In Ws-Addressing, Configure message id and configure callback/return url which is proxy 2 URL.
- Proxy 1 will call End service.
- When end service will finis with his activities, it will make a callback to URL which is provided in 3rd step.
- When callback URL will be called, Proxy 2 will be invoked.
Proxy 2:
- Callback URL is executed from proxy 1, Step 5.
- 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.
- Callback URL will invoked, and proxy 2 message flow will be executed.
- A JMS queue will be designed and business service configured for same.
- Invoke JMS queue business service from message flow.
- Insert Callback XML response in JMS queue.
Proxy 3:
- End user will send a unique message ID, which was send at the time of proxy 1 invocation.
- Proxy 3 message flow will executed.
- Proxy will invoke JMS queue business service, Which will select JMS queue message from message ID, Send in step 1.
- 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.
Very nice post , It was asked by one interviewer to me. Keep it up Sir (y)
ReplyDeleteAppian BPM online training
ReplyDeleteAppian BPM training
arcsight online training
arcsight training
Build and Release online training
Build and Release training
Dell Bhoomi online training
Dell Bhoomi training
Dot Net online training
Dot Net training
ETL Testing online training
ETL Testing training
Hadoop online training
Hadoop training
Tibco online training
Tibco training