Web Service Processing taking too long need help in re-design
Joined: Jul 18, 2002
Need some help on solving the following issue:
I have Web Service that takes arround 2 to 3 minutes to process. When a Consumer invokes a Web Service and then the respons is reached after 2 or 3 minutes because the processing of the Request takes that long. Now on the consumer side it times out and is not able to receive the response even though a response is generated on my end.
The database side processing of the request is what it takes time as I have whole bunch of Business Rules in the PL/SQL procedures. And to the consumer if the request is successful and passes some intial data validation that's all it needs and don't have to wait on the processing of the Database logic. So I am thinking of splitting the service where I receive the request and do initial validation and if it passes wants to send the response to consumer as this step only takes arround 10 seconds.
What is the best soultion to separate this logic. How can I handle a request and send the response and then continues the remaining processing may be in a different process. Should I use JMS i.e. once the request is validated I queue the message and right away send the response as the consumer don't have to worry what's goes on the Database side. All it needs is success if a request is ok and initial validation passes.
Or is there any other faster way to achieve this.
MB<br />Sun Certified Programmer for Java2 Platform
Joined: Apr 17, 2006
You are thinking on the right lines ie of using the JMS mechanism to refactor your synchronous interaction to asynchronous interaction. Thats a scalable way and also see this section in blueprints to use as checklist during your own implementation.