diff options
-rw-r--r-- | vespa-feed-client/abi-spec.json | 36 | ||||
-rw-r--r-- | vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java | 4 |
2 files changed, 38 insertions, 2 deletions
diff --git a/vespa-feed-client/abi-spec.json b/vespa-feed-client/abi-spec.json index ecac167cd8e..b4355cb0970 100644 --- a/vespa-feed-client/abi-spec.json +++ b/vespa-feed-client/abi-spec.json @@ -102,6 +102,22 @@ ], "fields": [] }, + "ai.vespa.feed.client.FeedClient$Throttler": { + "superClass": "java.lang.Object", + "interfaces": [], + "attributes": [ + "public", + "interface", + "abstract" + ], + "methods": [ + "public abstract void sent(long, java.util.concurrent.CompletableFuture)", + "public abstract void success()", + "public abstract void throttled(long)", + "public abstract long targetInflight()" + ], + "fields": [] + }, "ai.vespa.feed.client.FeedClient": { "superClass": "java.lang.Object", "interfaces": [ @@ -331,5 +347,25 @@ "public void <init>(ai.vespa.feed.client.DocumentId, java.lang.Throwable)" ], "fields": [] + }, + "ai.vespa.feed.client.StaticThrottler": { + "superClass": "java.lang.Object", + "interfaces": [ + "ai.vespa.feed.client.FeedClient$Throttler" + ], + "attributes": [ + "public" + ], + "methods": [ + "public void <init>(ai.vespa.feed.client.FeedClientBuilder)", + "public void sent(long, java.util.concurrent.CompletableFuture)", + "public void success()", + "public void throttled(long)", + "public long targetInflight()" + ], + "fields": [ + "protected final long maxInflight", + "protected final long minInflight" + ] } }
\ No newline at end of file diff --git a/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java b/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java index d3005227184..fe62db9e0bb 100644 --- a/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java +++ b/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java @@ -84,7 +84,7 @@ class HttpRequestStrategyTest { HttpRequest request = new HttpRequest("POST", "/", null, null); // Runtime exception is not retried. - cluster.expect((__, vessel) -> vessel.completeExceptionally(new RuntimeException("boom"))); + cluster.expect((__, vessel) -> vessel.completeExceptionally(new FeedException("boom"))); ExecutionException expected = assertThrows(ExecutionException.class, () -> strategy.enqueue(id1, request).get()); assertEquals("boom", expected.getCause().getMessage()); @@ -94,7 +94,7 @@ class HttpRequestStrategyTest { cluster.expect((__, vessel) -> vessel.completeExceptionally(new IOException("retry me"))); expected = assertThrows(ExecutionException.class, () -> strategy.enqueue(id1, request).get()); - assertEquals("retry me", expected.getCause().getMessage()); + assertEquals("retry me", expected.getCause().getCause().getMessage()); assertEquals(3, strategy.stats().requests()); // Successful response is returned |