summaryrefslogtreecommitdiffstats
path: root/vespa-feed-client
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-07-05 13:15:15 +0200
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-07-05 14:32:09 +0200
commitf2310d9629a6e186eb1ff735dcc0ebeac2855536 (patch)
tree56c5891a53cc3107c9c33c1c5cba8625638be72d /vespa-feed-client
parent321794ad856f2de8b71a95258db85b15f8653419 (diff)
Enable experimental feeder through feature flag
Diffstat (limited to 'vespa-feed-client')
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpFeedClient.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpFeedClient.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpFeedClient.java
index 730d9787735..c2181821de6 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpFeedClient.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpFeedClient.java
@@ -23,6 +23,7 @@ import java.time.Duration;
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
+import java.util.Optional;
import java.util.StringJoiner;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
@@ -54,7 +55,8 @@ class HttpFeedClient implements FeedClient {
private final boolean speedTest;
HttpFeedClient(FeedClientBuilderImpl builder) throws IOException {
- this(builder, builder.dryrun ? new DryrunCluster() : new ApacheCluster(builder));
+ this(builder, builder.dryrun ?
+ new DryrunCluster() : experimentalClientEnabled() ? new JettyCluster(builder) : new ApacheCluster(builder));
}
HttpFeedClient(FeedClientBuilderImpl builder, Cluster cluster) {
@@ -313,4 +315,13 @@ class HttpFeedClient implements FeedClient {
return query.toString();
}
+ private static boolean experimentalClientEnabled() {
+ String name = "VESPA_FEED_EXPERIMENTAL_CLIENT";
+ return Optional.ofNullable(System.getenv(name))
+ .map(Boolean::parseBoolean)
+ .orElse(Optional.ofNullable(System.getProperty(name))
+ .map(Boolean::parseBoolean)
+ .orElse(false));
+ }
+
}