Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E51A18E9A for ; Fri, 24 Apr 2015 11:24:04 +0000 (UTC) Received: (qmail 26459 invoked by uid 500); 24 Apr 2015 11:23:59 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 26413 invoked by uid 500); 24 Apr 2015 11:23:59 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 26400 invoked by uid 99); 24 Apr 2015 11:23:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Apr 2015 11:23:58 +0000 X-ASF-Spam-Status: No, hits=0.9 required=5.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: encountered temporary error during SPF processing of domain of joan.balaguero@grupoventus.com) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Apr 2015 11:23:52 +0000 Received: from mail01.feelhosting.com (mail01.feelhosting.com [178.33.117.161]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 7E02224E9F for ; Fri, 24 Apr 2015 11:23:11 +0000 (UTC) Received: from Ventus (81.184.19.24.dyn.user.ono.com [81.184.19.24]) by mail01.ad-6bits.net (Postfix) with ESMTPA id ED5BB40FE7 for ; Fri, 24 Apr 2015 13:22:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=grupoventus.com; s=default; t=1429874553; bh=m+i1Njhb9GBJQJEl8TrB1i5eQMwJlEwe/9xyHEPGGvc=; h=From:To:References:In-Reply-To:Subject:Date; b=YV7CULZz0qVlDWC8+aYt4uVaqlIKL98XiJ21duIh1Tcxp6oGrxPnZtb3GvccRPrnw FLB4lUkMoQLP2xogcy0+tO7HjtpX+BKgcvCRnt/A0d7AY/y5sS75Ox8/ZkXJPmIXb+ TQq5PV74aXTrbAb1nY8XDd1uhFvBWHp1giS/TG+Y= From: =?UTF-8?Q?Joan_Balaguer=C3=B3?= To: "'HttpClient User Discussion'" References: <8606c2c.2920.14ce3ef7abe.Coremail.qustmrhuang@163.com> <1429816999.26187.2.camel@apache.org> In-Reply-To: <1429816999.26187.2.camel@apache.org> Subject: RE: Fw:Fw:PoolingHttpClientConnectionManager how to reuse the connection Date: Fri, 24 Apr 2015 13:22:26 +0200 Message-ID: <003e01d07e80$f5441da0$dfcc58e0$@grupoventus.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQL/udjJ1f0gW4FDiFPrnIzOQJrc0gIlUYRTmuxh49A= Content-Language: es X-Virus-Checked: Checked by ClamAV on apache.org Hello, Regarding this posts: > Any help in this issue would be much appreciated.=20 > Thanks > mrhuang >=20 > I am not quite sure I understand the issue. You should not even be = using #releaseConnection in the first place. It is provided for = compatibility with HC 3.x. You should always close CloseableHttpResponse = in a try-finally or try-with-resources. > Oleg You say that using CloseableHttpResponse is the right way to release a = connection. Currently, our code to release a connection is the above = (works fine): if (entity !=3D null) { try { EntityUtils.consume(entity); } catch (Exception e) {} } else { if (objPost !=3D null) objPost.abort(); else if (objGet !=3D null) objGet.abort(); } Do you think it's preferrable to change this code by one that directly = closes the CloseableHttpResponse? Thanks, Joan. --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org