On Nov 18, 2013, at 4:56 AM, Yevgeny F <[email protected]> wrote: > I have a bunch of web services servers (around 200) running on the same > machine which expose the same service on different ports. I have a client > which perform tasks which include calling the service on different servers. > Something like: > > while (true) { > task = readTask(); > runHelloService(task.serverAddress) > } > > I was wondering what is the best way to generate the HelloService client > proxy. > Can I generate one and replace the target address before each call?
This may be OK as long as you override the address via the request context and don’t dig into the conduit/endpoint to change the address. Also, don’t reset anything auth specific or anything like that. The proxy is thread safe, but the underlying conduit does store some state (such as cookies) and such. > Should i generate a client per server (which means 200 client proxies) and > use the relevant one? > I will probably want to run the above loop concurrently on several threads. > Currently I have only one proxy which is generated by spring and cxf with > the jaxws:client declaration. You may want to consider either a pool of proxies or a proxy per thread (if low number of threads). -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
