CXF proxies ARE thread safe except for a couple of scenarios:

1) Use of the port.getRequestContext().   By default per JAX-WS spec, the 
request context is per port.   Thus, any settings set on that will affect 
other threads using the proxy.    You CAN do:
port.getRequestContext().put("thread.local.request.context", "true");
and future calls to getRequestContext() will use a thread local context.    In 
CXF, the response context is always thread local.

2)  Certain settings on the http conduit.   The conduit is per port, so 
anything that the conduit manipulates would not be safe.   The main one is 
sessions.   The session cookie is handled in the conduit.    Thus, the port 
is associated with a single session (if session is turned on).    Similarly, 
if you change the TLS settings, those would reflect across all the threads.

Basically, for the most part, you can create a single port and use it for MOST 
use cases.   

Does that help at all?

Dan


On Thursday 15 January 2009 1:11:59 pm dougnukem wrote:
> Gattu, Praveen wrote:
> > 3)Is the calls to the actual service sequential and does threads get
> > blocked on one another? If so is there a way I could configure CXF to
> > create a pool of connection objects for each port, is so how would I do
> > that. If not should I(a client) manage these external connection pools?
>
> Has there been any future response to this question?
>
> I'm interfacing with a SOAP web service from a JETTY servlet, and when
> handling mutliple requests we create a new Services and port for each
> request.
>
> Would I be able to reuse a single Service and port and have multiple
> requests (threads) calling methods on it? Or would the suggested solution
> be to create a limited pool of these ports and block requests until one of
> those pooled objects is available?



-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to