Skip to content

Commit

Permalink
Attempt to fix something 3
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Jul 4, 2024
1 parent 1975ac4 commit f910cec
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.hc.core5.http.HttpResponse;
import org.apache.hc.core5.http.nio.AsyncRequestProducer;
import org.apache.hc.core5.pool.PoolConcurrencyPolicy;
import org.apache.hc.core5.pool.PoolReusePolicy;
import org.apache.hc.core5.reactor.IOReactorConfig;
import org.apache.hc.core5.util.TimeValue;
import org.apache.hc.core5.util.Timeout;
Expand Down Expand Up @@ -131,6 +132,7 @@ public static void initHttpClient(int threadCount) {
.setMaxConnTotal(threadCount * 1000)
.setMaxConnPerRoute(threadCount * 1000)
.setPoolConcurrencyPolicy(PoolConcurrencyPolicy.LAX)
.setConnPoolPolicy(PoolReusePolicy.LIFO)
.setDefaultConnectionConfig(org.apache.hc.client5.http.config.ConnectionConfig.custom()
.setConnectTimeout(Timeout.ofSeconds(5))
.setValidateAfterInactivity(TimeValue.ofSeconds(5))
Expand All @@ -146,6 +148,7 @@ public static void initHttpClient(int threadCount) {
.setConnectionManager(connectionManager)
.setIOReactorConfig(ioReactorConfig)
.setKeepAliveStrategy(new DefaultConnectionKeepAliveStrategy())
.setConnectionManagerShared(false)
.setDefaultRequestConfig(RequestConfig.custom()
.setContentCompressionEnabled(false)
.setHardCancellationEnabled(true)
Expand Down

0 comments on commit f910cec

Please sign in to comment.