From f0037f8e9e591c8d5a77928ed633e4680bb9f06e Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Thu, 1 Feb 2024 11:50:17 +0100 Subject: [PATCH] WebClient: add a creation method with pool options Pooling options used to be included in WebClientOptions/HttpClientOptions, but they are now separate. Signed-off-by: Thomas Segismont --- .../java/io/vertx/ext/web/client/WebClient.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/vertx-web-client/src/main/java/io/vertx/ext/web/client/WebClient.java b/vertx-web-client/src/main/java/io/vertx/ext/web/client/WebClient.java index 8c5be3eb47..9eb2dba9b7 100644 --- a/vertx-web-client/src/main/java/io/vertx/ext/web/client/WebClient.java +++ b/vertx-web-client/src/main/java/io/vertx/ext/web/client/WebClient.java @@ -20,6 +20,7 @@ import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpClient; import io.vertx.core.http.HttpMethod; +import io.vertx.core.http.PoolOptions; import io.vertx.core.http.RequestOptions; import io.vertx.core.http.impl.HttpClientInternal; import io.vertx.core.net.SocketAddress; @@ -58,7 +59,7 @@ static WebClient create(Vertx vertx) { } /** - * Create a web client using the provided {@code vertx} instance. + * Create a web client using the provided {@code vertx} instance and default pooling options. * * @param vertx the vertx instance * @param options the Web Client options @@ -68,6 +69,18 @@ static WebClient create(Vertx vertx, WebClientOptions options) { return new WebClientBase(vertx.createHttpClient(options), options); } + /** + * Create a web client using the provided {@code vertx} instance. + * + * @param vertx the vertx instance + * @param options the Web Client options + * @param poolOptions the HTTP Client pool options + * @return the created web client + */ + static WebClient create(Vertx vertx, WebClientOptions options, PoolOptions poolOptions) { + return new WebClientBase(vertx.createHttpClient(options, poolOptions), options); + } + /** * Wrap an {@code httpClient} with a web client and default options. *