java - Resteasy client not closing connection -


i have found 1 scenario resteasy not closing connection. there way around this? have created client as:

threadsafeclientconnmanager cm = new threadsafeclientconnmanager(); httpclient httpclient = new defaulthttpclient(cm); clientexecutor executor = new apachehttpclient4executor(httpclient); t proxiedservice = org.jboss.resteasy.client.proxyfactory.create(clazz, base, executor); 

i calling following method on service

@delete @path("{id}") response deleteobject(@pathparam("id") long id); 

and service returning

http/1.1 500 internal server error [content-length: 0, server: jetty(8.1.2.v20120308)] 

any ideas on missing connection close. note: other response types, connections closing.

i know if don't return 500, work well. should such scenario accidentally happen, want client able handle it, without running out of connections.

i assuming following method belongs on resteasy client's proxied interface (?):

response deleteobject(@pathparam("id") long id); 

if so, problem here method returns resteasy clientresponse object (which resteasy implementation of jax-rs response). when method returns clientresponse, assume responsibility releasing connection.

in case, relying on proxy factory, may not possible release connection. in case, should change signature of method return either void or type of object expect in http response body:

@delete @path("{id}") void deleteobject(@pathparam("id") long id); 

or if expected foo object back:

@delete @path("{id}") foo deleteobject(@pathparam("id") long id); 

see resteasy transport layer documentation more information.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -