On Thu, 2019-05-09 at 12:42 +0200, Joan grupoventus wrote: > Hello, > > I can reproduce the issue, a HEAD method is being used, not GET. So > sending a HEAD method to our application using an > AsyncResponseConsumer hangs forever after calling the > 'consumeResponse' method (but sending the same request using GET > works). > In our code the only difference between head and get method is this: > AsyncRequestBuilder rb = this.request.isGetMethod() ? > AsyncRequestBuilder.get(uri) : AsyncRequestBuilder.head(uri); > > Rest of code is identical for both methods. Do I need to add some > additional code to our AsyncResponseConsumer to manage HEAD methods? > Since they don't have entity, 'consume' and 'streamEnd' are not > called. What should I do to finish reading the head response and > terminate the thread? > > Thanks, > Joan. >
Joan We have plenty of test coverage for HEAD methods. Please have a look at https://github.com/apache/httpcomponents-client/blob/master/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/AbstractHttpAsyncFundamentalsTest.java#L78 Oleg > > -----Original Message----- > From: Joan grupoventus <joan.balagu...@grupoventus.com> > Sent: Wednesday, May 8, 2019 7:24 PM > To: 'HttpClient User Discussion' <httpclient-users@hc.apache.org> > Subject: AsyncResponseConsumer thread stucked > > Hello, > > > > We are having the following issue. Before going deeper (traces, etc) > we would like to explain what we are seeing: > > > > HttpClient5 beta4 and HttpCore beta7 using an AsyncResponseConsumer. > > Requesting, via GET method, an image to an api: > http://192.168.6.131:80/simbolos/nevera.gif > > AsyncResponseConsumer consumeResponse method called correctly, and > getting a null EntityDetails > > At this point the thread gets stucked, streamEnd and failed methods > are never called, and the thread is released when the container > asynchronous timeout is reached. > > > > With the asynClient 4.1.3 this works, the > HttpAsyncResponseConsumer.responseReceived and responseCompleted > methods are called and the application reports a response with > content-length = 0. > > > > Must anything special be done when an > AsyncResponseConsumer.consumeResponse method receives a null > EntityDetails? > > > > Thanks, > > > > Joan. > > > > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org > For additional commands, e-mail: httpclient-users-h...@hc.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org