You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Hannes Schubert <hs...@scoop-gmbh.de> on 2009/06/12 17:06:51 UTC

True asynchronous Server

Hi all,

I read a lot of postings about asynchronous request processing on the server
site including jira-1835, jetty continuations, mixservices and so on...

Still I am puzzeling about the following issue:
if I look at the 2.2.1 cxf source code I determine that the
ServiceInvokerInterceptor invokes the SEI synchronously and all succeeding
interceptors are processed sequentially by PhaseInterceptorChain. Is it true
that actually there is no way to suspend the current web service processing
(e.g. because of waiting on much too slow database) and let the thread
resume with another chain from any other concurrent request?

Best regards

Hannes
-- 
View this message in context: http://www.nabble.com/True-asynchronous-Server-tp24000759p24000759.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: True asynchronous Server

Posted by Daniel Kulp <dk...@apache.org>.
On Fri June 12 2009 11:06:51 am Hannes Schubert wrote:
> Hi all,
>
> I read a lot of postings about asynchronous request processing on the
> server site including jira-1835, jetty continuations, mixservices and so
> on...
>
> Still I am puzzeling about the following issue:
> if I look at the 2.2.1 cxf source code I determine that the
> ServiceInvokerInterceptor invokes the SEI synchronously and all succeeding
> interceptors are processed sequentially by PhaseInterceptorChain. Is it
> true that actually there is no way to suspend the current web service
> processing (e.g. because of waiting on much too slow database) and let the
> thread resume with another chain from any other concurrent request?

With 2.2.1, you can IF you are using either JMS or Jetty standalone.   There 
isn't a way with the Servlet based transport.      From the WebServiceContext, 
you can call:

 ContinuationProvider provider = 
            (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName());

which will get the ContinuationProvider.  For Jetty standalone, that would 
wrapper the Jetty continuations stuff.   For JMS, it will use an 
implementation specific for JMS.   

You can see it working for some of our system tests:
http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/
http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/

Hope that helps!

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog