diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-05-21 09:48:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 09:48:06 +0200 |
commit | 210a4d758a10af61fe8a0615a318fc1393bd5961 (patch) | |
tree | f5b0db3c194a409517bc5376a28af575b4035933 /vespa-feed-client | |
parent | f907c28b6f6f3653d9ed464f726571507d05503c (diff) | |
parent | 63fbae98340206a8502a343cda0b9d3561511b97 (diff) |
Merge pull request #17928 from vespa-engine/jonmv/http-2-feed
Simplify, and use "initial()" H2Config as base
Diffstat (limited to 'vespa-feed-client')
-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() |