I've requirement to start some processing after receiving a request and validating the same. The return of the web service response needs to be sent immediately after kicking off the process and shouldn't wait for it to be finished.
One possible way to do this was using different threads. But, my application is deployed on weblogic and for web service, it's using axis 1.4 (old application). I've read that it's not a good idea to create our own threads when weblogic is managing the same.
I am sure that this is very regular scenario so can any one guide me about what should be the correct approach?
Since you are using an application server, have you considered sending asynchronous messages to a message driven bean?
This way, the web service is free to return immediately and there can be multiple instances of the MDB processing requests in parallel.
If you are able to use EJB 3.1, you do not need to use an MDB, since regular session beans can also be invoked asynchronously.
Right, if you only need asynchronicity, then an asynchronous web service will suffice.
I was under the impression that you wanted parallel processing when I wrote my reply.
Joined: Sep 19, 2011
Thanks for the replies.
And yes, only asynchronous operation will do the trick for me. What I want is to trigger some processes and without waiting for them to complete, return the web service response to client.
I don't want to go for asynchronous web service as I want to avoid the serialization overhead. But, I wonder if we have any way of calling these web services locally. Also, Axis 1.4 - not sure if it supports asynchronous web service.
Joined: Jul 26, 2011
1. If you draw a UML sequence diagram for the section/link given, you will see the complete flow proposed.