diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-05-20 18:45:21 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-05-20 18:45:21 +0200 |
commit | 63fbae98340206a8502a343cda0b9d3561511b97 (patch) | |
tree | 9836effb07cd74055821d4d02a27e23ff4145260 /vespa-feed-client/src | |
parent | 864eb3da782e9795826ec78add953a76eeb2ea17 (diff) |
Simplify, and use "initial()" H2Config as base
Diffstat (limited to 'vespa-feed-client/src')
-rw-r--r-- | vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpFeedClient.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpFeedClient.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpFeedClient.java index fc1637fe17f..64b99961e61 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpFeedClient.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpFeedClient.java @@ -11,6 +11,7 @@ import org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder; import org.apache.hc.core5.concurrent.FutureCallback; import org.apache.hc.core5.http.ContentType; import org.apache.hc.core5.http.message.BasicHeader; +import org.apache.hc.core5.http2.HttpVersionPolicy; import org.apache.hc.core5.http2.config.H2Config; import org.apache.hc.core5.net.URIBuilder; import org.apache.hc.core5.pool.PoolConcurrencyPolicy; @@ -73,17 +74,17 @@ class HttpFeedClient implements FeedClient { .setConnectionRequestTimeout(Timeout.DISABLED) .setResponseTimeout(Timeout.ofMinutes(5)) .build()) - .setH2Config(H2Config.custom() + .setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_2) + .setH2Config(H2Config.initial() .setMaxConcurrentStreams(builder.maxStreamsPerConnection) .setCompressionEnabled(true) .setPushEnabled(false) .build()); - int maxConnections = builder.maxConnections; PoolingAsyncClientConnectionManagerBuilder connectionManagerBuilder = PoolingAsyncClientConnectionManagerBuilder.create() .setConnectionTimeToLive(TimeValue.ofMinutes(10)) - .setMaxConnTotal(maxConnections) - .setMaxConnPerRoute(maxConnections) + .setMaxConnTotal(builder.maxConnections) + .setMaxConnPerRoute(builder.maxConnections) .setPoolConcurrencyPolicy(PoolConcurrencyPolicy.LAX); if (builder.sslContext != null) { ClientTlsStrategyBuilder tlsStrategyBuilder = ClientTlsStrategyBuilder.create() |