Enum TlsWarmup
- java.lang.Object
-
- java.lang.Enum<TlsWarmup>
-
- io.fabric8.kubernetes.client.vertx.TlsWarmup
-
- All Implemented Interfaces:
Serializable,Comparable<TlsWarmup>
public enum TlsWarmup extends Enum<TlsWarmup>
Controls how aggressively the Vert.x HTTP client warms up the JDK/Netty TLS stack off the Vert.x event loop when a client is built.Vert.x materialises the Netty
SslContext, theSslHandlerand theSSLEnginelazily on the event loop on the first TLS connection, which on a cold or CPU-throttled JVM pays the one-time class loading of the entire TLS stack on the loop and can trip theBlockedThreadChecker(or, under hard throttling, the connect timeout). Warming the stack once per JVM off the event loop relocates that cost. See fabric8io/kubernetes-client#7926.The mode is configured programmatically on the Vert.x HTTP client factory, for example:
VertxHttpClientFactory factory = new VertxHttpClientFactory(); factory.setTlsWarmup(TlsWarmup.FULL); KubernetesClient client = new KubernetesClientBuilder().withHttpClientFactory(factory).build();
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONTEXTBuild the NettyJdkSslContexteagerly on the building thread and hand it to Vert.x (the default).FULLIn addition to the eager context pre-build ofCONTEXT, run a complete throwaway loopback TLS handshake on the building thread, once per JVM.OFFNo warm-up.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TlsWarmupvalueOf(String name)Returns the enum constant of this type with the specified name.static TlsWarmup[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
OFF
public static final TlsWarmup OFF
No warm-up. The NettyJdkSslContextis built lazily by Vert.x on the event loop on the first connection (the behaviour before #7922).
-
CONTEXT
public static final TlsWarmup CONTEXT
Build the NettyJdkSslContexteagerly on the building thread and hand it to Vert.x (the default). This keeps the SSL context construction off the event loop. This is the behaviour introduced in #7922 and is sufficient for most environments.
-
FULL
public static final TlsWarmup FULL
In addition to the eager context pre-build ofCONTEXT, run a complete throwaway loopback TLS handshake on the building thread, once per JVM. A tiny self-signed HTTPS server is stood up on127.0.0.1, one client handshake is driven against it and both are torn down. This warms the full Netty + JDK TLS class path and the Vert.x connect path, so the first real connection no longer blocks the event loop. It runs synchronously, adding the warm-up cost to client construction (sub-second on a healthy host, a few seconds under hard CPU throttling), which is the explicit trade opt-in users make to avoid a first-connection timeout. The bind and handshake are bounded by a single overall deadline (about 30 seconds), after which the warm-up gives up and falls back rather than blocking for long; because it blocks the building thread, do not build aFULL-configured client from a Vert.x event-loop thread. Best-effort: if the loopback handshake cannot run (for example a blocked loopback bind), the eager context pre-build ofCONTEXTstill applies.
-
-
Method Detail
-
values
public static TlsWarmup[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TlsWarmup c : TlsWarmup.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TlsWarmup valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-