Enum 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, the SslHandler and the SSLEngine lazily 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 the BlockedThreadChecker (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:

    
     Vertx5HttpClientFactory factory = new Vertx5HttpClientFactory();
     factory.setTlsWarmup(TlsWarmup.FULL);
     KubernetesClient client = new KubernetesClientBuilder().withHttpClientFactory(factory).build();
     
    • Enum Constant Detail

      • OFF

        public static final TlsWarmup OFF
        No warm-up. The TLS stack is materialised lazily by Vert.x on the event loop on the first connection (the behaviour before #7922).
      • CONTEXT

        public static final TlsWarmup CONTEXT
        Build and discard a Netty SslContext on the building thread (the default). This loads the SSL engine and cipher catalogue off the event loop but not the SslHandler/handshake classes. This is the behaviour introduced in #7922 and is sufficient for most environments.
      • FULL

        public static final TlsWarmup FULL
        Run a complete throwaway loopback TLS handshake on the building thread, once per JVM. A tiny self-signed HTTPS server is stood up on 127.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 a FULL-configured client from a Vert.x event-loop thread. Best-effort: if the warm-up cannot run (for example a blocked loopback bind), the client falls back to CONTEXT.
    • 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 name
        NullPointerException - if the argument is null