Thanks for the leads -- more questions inline.

> On Aug 30, 2016, at 11:36 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
> 
> On Mon, 2016-08-29 at 13:49 -0700, Steven Schlansker wrote:
>> Hi httpclient-users,
>> 
>> I am using HttpClient 4.5.2 / HttpCore 4.4.5 to connect to a streaming 
>> endpoint.  The endpoint returns chunked records essentially forever.
>> My application consumes these never ending records until an operator signals 
>> it to stop.  The code looks something like:
>> 
>> How can I abort this connection cleanly, without needing to read to the end 
>> of a
>> never ending stream of data from the server?
>> 
> 
> There are two options:
> (1) Close the response without closing the content input stream

I am looking at the HttpResponse interface (and its superinterface, 
HttpMessage) and not seeing
anything like close().  The interfaces expose almost exclusively getter / 
setter pairs.

Did I miss something obvious here?

> (2) Abort the request

This one is tricky -- we use the HttpClient through RESTEasy's JAX-RS Client
implementation, so we don't have access to the actual request object.

I've filed https://issues.jboss.org/browse/RESTEASY-1478 as a request for this.

> In both cases the underlying connection will be shut down immediately
> and returned to the connection pool.

I've gotten this working with reflective hackery (to access the request object)
in the meantime.  Thanks for your help.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to