8000 [Quarkus 4] Preserve HTTP connection pool configuration with Vert.x 5 by Pepo48 · Pull Request #54574 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.PoolOptions;
import io.vertx.core.net.KeyStoreOptions;
import io.vertx.ext.web.client.WebClient;
import io.vertx.ext.web.client.WebClientOptions;
Expand Down Expand Up @@ -113,7 +114,7 @@ private void lazyInit(KeycloakSession session) {
if (webClient == null) {
Vertx vertx = Arc.requireContainer().instance(Vertx.class).get();
WebClientOptions options = buildOptions(session);
httpClient = vertx.createHttpClient(options);
httpClient = vertx.createHttpClient(options, buildPoolOptions());
webClient = WebClient.wrap(httpClient, options);
logger.info("Vert.x HTTP client initialized (HTTP_CLIENT_V2)");
}
Expand All @@ -124,8 +125,6 @@ private void lazyInit(KeycloakSession session) {
private WebClientOptions buildOptions(KeycloakSession session) {
WebClientOptions options = new WebClientOptions();

options.setMaxPoolSize(config.getInt("max-pooled-per-route", 64));

long connectTimeout = config.getLong("establish-connection-timeout-millis", -1L);
if (connectTimeout > 0) {
options.setConnectTimeout((int) connectTimeout);
Expand All @@ -151,6 +150,10 @@ private WebClientOptions buildOptions(KeycloakSession session) {
return options;
}

private PoolOptions buildPoolOptions() {
return new PoolOptions().setHttp1MaxSize(config.getInt("max-pooled-per-route", 64));
}

private void configureTls(KeycloakSession session, WebClientOptions options) {
boolean disableTrustManager = config.getBoolean("disable-trust-manager", false);
if (disableTrustManager) {
Expand Down
Loading
0