How would you solve the following Synch Async scenario?

Discussions

General J2EE: How would you solve the following Synch Async scenario?

  1. 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

    Threaded Messages (1)

  2. 206usd laptop for sale[ Go to top ]

    【Model: S30 【CPU: INTEL ATOM N270 1.6GHz 【LCD Display: 10.2 " TFT(1024*600) 【Operating System:Windows XP Home/Windows Vista 【Chipset: Intel 945GSE+ICH7-M 【Ram:256MB ~2GB 【Storage:40G ~ 320G 【Lan:Built-in 10/100M LAN 【Built-in Wi-Fi:802.11 b/g 【Graphic Card:INTEL GMA950 【Audio:Integrated 【Camera:1.3M Pixels 【Power:3 core lithium-ion battery, 2.5 hours (10.8V/30W 【Size:252*184*25.5mm 【Color:Black,Red,Yellow,White,Pink 【Weight:1.2KG 【I/O ports:2 x USB 2.0 * 1 x Network connector (RJ45) 1 x SD/MS/MMC/MS-pro card slot 1 x 15-pin VGA video connector 1 x Mic jack*1 x AC adapter connector