我发现了一个情况,即resteasy没有关闭连接。有什么解决办法吗?我的客户端创建方式如下:
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);
我正在服务上调用以下方法。
@DELETE
@Path("{id}")
Response deleteObject(@PathParam("id") Long id);
服务正在返回结果
HTTP/1.1 500 Internal Server Error [Content-Length: 0, Server: Jetty(8.1.2.v20120308)]
你有什么想法,我为什么无法关闭连接。请注意:对于所有其他响应类型,连接都会关闭。
我知道如果我不返回500,一切都会很顺利。但是如果意外发生这种情况,我希望我的客户端能够处理它,而不会耗尽连接。