Class Vertx5HttpClientFactory
- java.lang.Object
-
- io.fabric8.kubernetes.client.vertx5.Vertx5HttpClientFactory
-
- All Implemented Interfaces:
HttpClient.Factory
public class Vertx5HttpClientFactory extends Object implements HttpClient.Factory
Vert.x 5 implementation ofHttpClient.Factory.When constructed with a non‑null
Vertxthe same instance is reused for every client; otherwise eachnewBuilder()call will lazily create (and own) its own Vert.x runtime.Important: This HTTP client requires Vert.x 5.x runtime classes. It is mutually exclusive with
kubernetes-httpclient-vertx(Vert.x 4.x). Including both on the classpath will cause runtime errors due to incompatible Vert.x API versions. Ensure your project excludes one or the other.
-
-
Constructor Summary
Constructors Constructor Description Vertx5HttpClientFactory()Return a factory that reuses the supplied Vert.x instance.Vertx5HttpClientFactory(io.vertx.core.Vertx vertx)Create a new instance of the factory that will reuse the providedVertxinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadditionalConfig(io.vertx.ext.web.client.WebClientOptions webClientOptions, io.vertx.core.http.WebSocketClientOptions wsOptions, io.vertx.core.http.PoolOptions poolOptions)Additional configuration to be applied to the options after theConfighas been processed.TlsWarmupgetTlsWarmup()Returns the configuredTlsWarmupmode (nevernull).Vertx5HttpClientBuilder<Vertx5HttpClientFactory>newBuilder()– reuses the shared Vert.x when present, otherwise defers creation to the builder.voidsetTlsWarmup(TlsWarmup tlsWarmup)Configures how the TLS stack is warmed up off the Vert.x event loop when a TLS-enabled client is built.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.fabric8.kubernetes.client.http.HttpClient.Factory
newBuilder, priority
-
-
-
-
Constructor Detail
-
Vertx5HttpClientFactory
public Vertx5HttpClientFactory()
Return a factory that reuses the supplied Vert.x instance.
-
Vertx5HttpClientFactory
public Vertx5HttpClientFactory(io.vertx.core.Vertx vertx)
Create a new instance of the factory that will reuse the providedVertxinstance.It's the user's responsibility to manage the lifecycle of the provided Vert.x instance. Operations such as close, and so on are left on hands of the user.
- Parameters:
vertx- the Vertx instance to use.
-
-
Method Detail
-
newBuilder
public Vertx5HttpClientBuilder<Vertx5HttpClientFactory> newBuilder()
– reuses the shared Vert.x when present, otherwise defers creation to the builder.- Specified by:
newBuilderin interfaceHttpClient.Factory- Throws:
IllegalStateException- if Vert.x 5 runtime classes are not available on the classpath
-
additionalConfig
protected void additionalConfig(io.vertx.ext.web.client.WebClientOptions webClientOptions, io.vertx.core.http.WebSocketClientOptions wsOptions, io.vertx.core.http.PoolOptions poolOptions)Additional configuration to be applied to the options after theConfighas been processed.- Parameters:
webClientOptions- the HTTP client optionswsOptions- the WebSocket client optionspoolOptions- the connection pool options
-
getTlsWarmup
public TlsWarmup getTlsWarmup()
Returns the configuredTlsWarmupmode (nevernull).- Returns:
- the TLS warm-up mode applied when building TLS-enabled clients
-
setTlsWarmup
public void setTlsWarmup(TlsWarmup tlsWarmup)
Configures how the TLS stack is warmed up off the Vert.x event loop when a TLS-enabled client is built. SeeTlsWarmupfor the trade-offs of each mode.- Parameters:
tlsWarmup- the warm-up mode;nullresets it to the defaultTlsWarmup.CONTEXT
-
-