Hi, I have the following use case and would like to know thoughts from the community on how to solve it - There is a web based portal sending a create order request to ESB and the ESB does some message processing and passes it to a CRM to complete the order processing and generate a order id to be sent back to the portal user. Non Functional Requirements - 1) Reliability 2) Performance in terms of response time to the user. Issues - 1) The web service exposed by CRM takes a long time to process the request and it is not acceptable that the Portal end user waits for that long to get the Order ID back.. 2) If we make a SOAP/HTTP call from Portal --> ESB and then another SOAP/HTTP call from ESB ---> CRM then the reliability is compromised. Solution - The solution that we are proposing is as follows - 1) Make a SOAP/HTTP call from Portal to ESB and then put the message in a JMS Queue which will persist it. This will provide reliability and QOS. 2) Generate a random unique number (which will act as the order id for the user) inside the ESB and send it back to the user immediately after persisting the message in the queue. Also persist this interim order id in a database. 3) Pick the message from the queue using MDB or Proxy service (specific to Oracle Service Bus because that is what we have as an ESB) and send the message to CRM. 4) CRM takes its own time to process the request from MDB and sends the response (actual OrderID in CRM) which is then persisted corresponding to the row in step#2. Thus for future search by the user we can use this mapping to get the actual order details from CRM. I do not see this as a scenario which is unique or unusual, where an Asynch request needs to made to look as synch to the user. But the solution we are proposing seems to be crude to me and with loopholes (like how to handle scenarios where CRM returns an error etc.) which would require lot of effort to be fixed. Questions - 1) What is your opinion about the solution and suggestions about a better/cleaner way to implement it? 2) Is there any standard approach to solve such kind of issue without creating so much of complexity (where we have to write code to keep the mapping and take care of all other issues)? 3) Is there any pattern that can help solve this problem? 4) Have you ever faced this issue and how did you solve it? Regards Ananya
- Posted by: Ananya Bhushan
- Posted on: February 23 2010 21:41 EST
- Re: How would you solve the following Synch Async scenario? by kyaw naing on February 23 2010 23:13 EST
- How would you solve the following Synch Async scenario? by Guillermo Moscoso on March 26 2010 06:18 EDT
May I suggest some REST? george http://ethicminds.blogspot.com/
I face the same problem, where for every order both a Mid office system and a CRM server have to be notified. So these operations are currently done synchronously by the server in the first release. It is very slow.What you propose is indeed interesting but how are you going to handle errors (I mean functionally), like the CRM server failing ?