Re: Dealing with CLOSE_WAIT connections

2015-08-06 Thread Sergey Beryozkin
Hi It can be enabled on a per proxy or webclient instance, WebClient.getConfig(proxy).getResponseContext().put("response.stream.auto.close", true); Indeed, as far the client runtime is concerned, it can auto-close by default but can avoid it for some well-known types (ex, Document, Source),

Re: Dealing with CLOSE_WAIT connections

2015-08-05 Thread Xiaobin
Appreciate the clarification, Sergey! One more further question, while using proxy based client, is it possible/good-practice to conditionally enable/disable auto-closure of stream ? For example: we generate a proxy based on class Foo, Foo.getA() needs to keep the stream open, while Foo.getB()

Re: Dealing with CLOSE_WAIT connections

2015-08-05 Thread Sergey Beryozkin
Hi All, One thing which is interesting here is that in case of WebClient, if the auto-closure is disabled, it is the responsibility of the client code to do Response.close JAX-RS API allows to do something like InputStream is = client.get(InputStream.class) or Response r = client.get(); Inp

Re: Dealing with CLOSE_WAIT connections

2015-08-05 Thread Jose María Zaragoza
2015-08-05 18:55 GMT+02:00 Daniel Kulp : > >> On Aug 5, 2015, at 12:04 PM, Jose María Zaragoza >> wrote: >> >> >> I'm trying to understand how is the high-level behaviour ( client side, so >> far ) >> Please, let me know if I'm wrong ( I'm sure about that ) >> >> 1) I guess that a WebClient inst

Re: Dealing with CLOSE_WAIT connections

2015-08-05 Thread Daniel Kulp
> On Aug 5, 2015, at 12:04 PM, Jose María Zaragoza wrote: > > > I'm trying to understand how is the high-level behaviour ( client side, so > far ) > Please, let me know if I'm wrong ( I'm sure about that ) > > 1) I guess that a WebClient instance uses a new HttpURLConnection per > thread/IO o

Re: Dealing with CLOSE_WAIT connections

2015-08-05 Thread Jose María Zaragoza
2015-08-05 15:03 GMT+02:00 Sergey Beryozkin : > If you close it then this particular instance will become unusable... > > I'll need to ask Dan if implementing AutoCloseable or Closeable can help > with closing such clients that are created in Spring contexts, but you can > always close it if you ha

Re: Dealing with CLOSE_WAIT connections

2015-08-05 Thread Sergey Beryozkin
If you close it then this particular instance will become unusable... I'll need to ask Dan if implementing AutoCloseable or Closeable can help with closing such clients that are created in Spring contexts, but you can always close it if you have Spring calling a destroy method in your bean tha

Re: Dealing with CLOSE_WAIT connections

2015-08-05 Thread Jose María Zaragoza
2015-08-05 12:08 GMT+02:00 Sergey Beryozkin : > Hi > On 04/08/15 20:26, Jose María Zaragoza wrote: >> >> 2015-08-02 23:12 GMT+02:00 Sergey Beryozkin : >>> >>> Hi >>> Can you cast a proxy to WebClient (via its utility method >>> WebClient.client()) and close it, and also enable the auto-closure of t

Re: Dealing with CLOSE_WAIT connections

2015-08-05 Thread Sergey Beryozkin
Hi On 04/08/15 20:26, Jose María Zaragoza wrote: 2015-08-02 23:12 GMT+02:00 Sergey Beryozkin : Hi Can you cast a proxy to WebClient (via its utility method WebClient.client()) and close it, and also enable the auto-closure of the Response ? Sergey Hi I'm using CXF 2.7.8 to invoke REST service

Re: Dealing with CLOSE_WAIT connections

2015-08-04 Thread Jose María Zaragoza
2015-08-02 23:12 GMT+02:00 Sergey Beryozkin : > Hi > Can you cast a proxy to WebClient (via its utility method > WebClient.client()) and close it, and also enable the auto-closure of the > Response ? > Sergey Hi I'm using CXF 2.7.8 to invoke REST services by WebClient API & JAX-RS Client Proxy-ba

Re: Dealing with CLOSE_WAIT connections

2015-08-03 Thread Sergey Beryozkin
Hi, I do not recall right now, I think we had it done possibly earlier too, but it caused well-known side-effects, so it is only done now if the property is set Thanks, Sergey On 03/08/15 22:17, Xiaobin wrote: Thanks Sergey. WebClient.client() and invoking close() seems help. Most of the conne

Re: Dealing with CLOSE_WAIT connections

2015-08-03 Thread Xiaobin
Thanks Sergey. WebClient.client() and invoking close() seems help. Most of the connections transitioned to TIME_WAIT and eventually get closed. Btw, isn't auto-closure of the response available only from CXF 2.7.7 ? -Xiaobin 2015-08-02 14:12 GMT-07:00 Sergey Beryozkin : > Hi > Can you cast a pr

Re: Dealing with CLOSE_WAIT connections

2015-08-02 Thread Sergey Beryozkin
Hi Can you cast a proxy to WebClient (via its utility method WebClient.client()) and close it, and also enable the auto-closure of the Response ? Sergey On 31/07/15 02:59, Xiaobin wrote: Hi guys, I am using CXF 2.7.5. I have an application using JAXRSClientFactoryBean to generate proxy, and u

Dealing with CLOSE_WAIT connections

2015-07-30 Thread Xiaobin
Hi guys, I am using CXF 2.7.5. I have an application using JAXRSClientFactoryBean to generate proxy, and use following code to close client when it is done: ClientConfiguration config = WebClient.getConfig(root); HTTPConduit conduit = config.getHttpConduit(); if (conduit == null) {