summaryrefslogtreecommitdiffstats
path: root/vespa-feed-client-api
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-10-27 16:57:35 +0200
committerjonmv <venstad@gmail.com>2023-10-27 16:57:35 +0200
commitc79578f4331f2b8433b3ede5841bdf910164d564 (patch)
treebc896b42c771bf2c531cdb4774c8957aee69fe35 /vespa-feed-client-api
parentd93fbc20d3d39aeafa193fa3649399968af02cc2 (diff)
Allow specifying connection TTL for feed client
Diffstat (limited to 'vespa-feed-client-api')
-rw-r--r--vespa-feed-client-api/abi-spec.json1
-rw-r--r--vespa-feed-client-api/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java4
2 files changed, 5 insertions, 0 deletions
diff --git a/vespa-feed-client-api/abi-spec.json b/vespa-feed-client-api/abi-spec.json
index e8c2b4a3c9e..907d974ff09 100644
--- a/vespa-feed-client-api/abi-spec.json
+++ b/vespa-feed-client-api/abi-spec.json
@@ -144,6 +144,7 @@
"public static void setFeedClientBuilderSupplier(java.util.function.Supplier)",
"public abstract ai.vespa.feed.client.FeedClientBuilder setConnectionsPerEndpoint(int)",
"public abstract ai.vespa.feed.client.FeedClientBuilder setMaxStreamPerConnection(int)",
+ "public abstract ai.vespa.feed.client.FeedClientBuilder setConnectionTimeToLive(java.time.Duration)",
"public abstract ai.vespa.feed.client.FeedClientBuilder setSslContext(javax.net.ssl.SSLContext)",
"public abstract ai.vespa.feed.client.FeedClientBuilder setHostnameVerifier(javax.net.ssl.HostnameVerifier)",
"public abstract ai.vespa.feed.client.FeedClientBuilder setProxyHostnameVerifier(javax.net.ssl.HostnameVerifier)",
diff --git a/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java b/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java
index 270ecad6af8..7101b8452ed 100644
--- a/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java
+++ b/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java
@@ -7,6 +7,7 @@ import java.net.URI;
import java.nio.file.Path;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
+import java.time.Duration;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -63,6 +64,9 @@ public interface FeedClientBuilder {
*/
FeedClientBuilder setMaxStreamPerConnection(int max);
+ /** Sets a duration after which this client will recycle active connections. This is off ({@code Duration.ZERO}) by default. */
+ FeedClientBuilder setConnectionTimeToLive(Duration ttl);
+
/** Sets {@link SSLContext} instance. */
FeedClientBuilder setSslContext(SSLContext context);