Oliver Wulff-2 wrote > I was thinking in providing a pool of CXF client objects (not STS client > objects). > > IMHO, in general, I'd prefer to have no dependency whether a programmer > uses one proxy instance for all requests or a new one for each request. > The creation if a proxy instance is "expensive" (download wsdl from remote > location, parsing (incl. policies), ...). > > Therefore, I was thinking of a pool of CXF client objects (the parsed wsdl > data could just be cloned (in case not thread safe)). Then, it would be > fine to have a non thread safe STSClient also. > > It should also address the other exceptions described here: > http://cxf.apache.org/faq#FAQ-AreJAXWSclientproxiesthreadsafe > > Thanks > Oli
Hi Oli, A little bit late but did you get to create such a pool in the end? I am creating programmatically the proxy from within a Spring bean and it takes around 500ms to do that when the whole call end-to-end takes no more than 600ms. I have seen a few examples of creating pool of objects but am not sure a) if I should store the object of MyServiceObj = new MyService(WSDL_LOCATION, SERVICE) (I believe not as this is the thread safe and inexpensive Service class instantiation which can also be created with the factory method MyServiceObj = MyService.create(WSDL_LOCATION, SERVICE) OR the MyServiceObj.getPort() (I belive this is the one needed to be pooled) b) Once pooled I can have a mechanism to instantiate at context load (I would assume) the pool and get/return the objects from my clients BUT at return do we need to "clean" them (ie. if any changes to the context occur?) else how does this make the port Thread Safe if it is littered of another thread's context. Some pointers on the cleaning (I believe you may have a clone of the context in your case but not sure how that would work) would also be appreciated. Thanks in advance -- View this message in context: http://cxf.547215.n5.nabble.com/Proxy-object-used-in-multi-threaded-case-tp4917256p5718957.html Sent from the cxf-user mailing list archive at Nabble.com.
