Questions tagged [apache-httpasyncclient]

HttpAsyncClient component of the Apache HttpComponents project.

92 questions
2
votes
1 answer

httpasyncclient OutOfMemoryError Direct buffer memory

i use httpasyncclient 4.1, i found that the direct memory continuously growing. and finally throw java.lang.OutOfMemoryError. Exception in thread "I/O dispatcher 2" java.lang.OutOfMemoryError: Direct buffer memory at…
1
vote
0 answers

HTTP response caching with Spring WebClient

I am trying to figure out how to cache responses based on the Cache-Control (and related) headers with Spring WebClient. I am aware that caching and a reactive approach do not go naturally hand in hand and that one should use in memory caching. I…
hotzst
  • 7,238
  • 9
  • 41
  • 64
1
vote
2 answers

got 'CancellationException: Request execution cancelled' always when throwing an exception in httpasyncclient callback

I use HttpAysnClient to do http requests, and I found when I throw an exception in the failed callback, the next request always be failed, how to fix it? I use maven dependency: 'org.apache.httpcomponents:httpasyncclient:4.1.5'. my java test…
BaiTang
  • 35
  • 1
  • 6
1
vote
0 answers

"IllegalStateException: Unexpected request state READY" when using HttpAsyncClient under high concurrency

We have a HttpAsyncUtil to process HTTP POST requests. public class HttpAsyncUtil { private static CloseableHttpAsyncClient client = null; static { try { // Connect time out: 2s, read time out: 10s, request time out:…
1
vote
0 answers

How to unit test responses of FutureCallback with ApacheAsyncHttpClient

I am trying to figure out how to unit test the callback methods of a FutureCallback, but can't quite figure it out. I have the following code: val latch = CountDownLatch(10) httpClient.execute(httpPost, object:…
1
vote
1 answer

HttpComponentsClientHttpConnector is not accepting org.apache.http.impl.nio.client.CloseableHttpAsyncClient for Webclient with Apache Http Client

Im trying to run Webflux on Tomcat and try to create Sping WebClient with Apache Http Client. Reference Documentation stated that theres built-in…
1
vote
0 answers

How to troubleshoot Apache client 5.0 "Connection is closed" HTTPS POST error

I have a Tomcat server configured for HTTP1.1 and HTTP/2 on port 8002, and also HTTPS on port 8003 to allow me to test against. I am writing Java code using Apache HTTP Client 5.0 to talk HTTP/2 to the server and having issues. Ultimately, I want to…
1
vote
2 answers

Apache HTTP/2 Client 5.0 POST request missing payload/content

I have a small sample servlet deployed to a Tomcat that will echo back any received parameters. The Tomcat is configured to support HTTP/1.1 and HTTP/2. I can use curl to make GET requests to the servlet demonstrating it works over both HTTP/1.1 and…
1
vote
1 answer

Custom SSLContext per HTTPS request with Apache HTTPAsyncClient

I have built a client using Apache HTTP Async Client library, I have a pool of http/https requests. The problem is that I need to execute https requests using a Certificate and Client private key. I was able to do that but there is only one…
Hadesk68
  • 31
  • 3
1
vote
1 answer

Apache AsyncHttpClient 4.1.4 creating new socket connection instead of reusing connection from Connection pool

We are using Apache AsyncHttpClient having below dependencies [INFO] +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile [INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.10:compile [INFO] | +-…
1
vote
1 answer

Apache HttpAsyncClient and CountDownLatch

When using apache htttpasyncclient how does one handle various exception cases properly? Consider the following pseudo code based on this example where I have added the consumer parameter to the execute call. The intention is to make an asynchronous…
user782220
  • 10,677
  • 21
  • 72
  • 135
1
vote
0 answers

SocketTimeOutException and ConnectionClosedException with JestClient

We are using JestClient to connect to Elastic search.(io.searchbox.client.JestClient). And using executeAsync method to write to Elastic search. We have same code deployed on different enviornment like dev, test,..prod. On Dev with nominal load we…
1
vote
1 answer

Apache Commons AsyncClient - Ignore Certificates - SSLPeerUnverifiedException

Thought I disabled checking certs in my Http Client, but keep getting SSLPeerUnverifiedException. Here's my client: import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import…
liltitus27
  • 1,670
  • 5
  • 29
  • 46
1
vote
1 answer

Async response streaming with Apache Async Http client

I am using apache async http client to stream objects from azure storage. I only need to return the HttpResponse object which has the stream associated. My clients will actually have to read from that stream to store the file locally. So Apache…
1
vote
1 answer

Ignore self signed certificates in AsyncClientHttp2Multiplexing

I'm trying to create multiple asynchronous HTTP connections using single client endpoint I have tried the multiplexing example given in Apache site the code snippet is as follows, final IOReactorConfig ioReactorConfig = IOReactorConfig.custom() …