Class HttpClientProperties.HttpClientPropertiesBuilder

    • Method Detail

      • maxIdleTime

        public HttpClientProperties.HttpClientPropertiesBuilder maxIdleTime​(Integer maxIdleTime)
        Set the maximum time persistent connections can stay idle while kept alive in the connection pool. Connections whose inactivity period exceeds this value will get closed and evicted from the pool. Defaults to 120 seconds (2 minutes).
        Parameters:
        maxIdleTime - the maximum idle time expressed in seconds
        Returns:
        the builder instance
      • keepAlive

        public HttpClientProperties.HttpClientPropertiesBuilder keepAlive​(boolean keepAlive)
        Set whether or not a custom connection keep-alive time should be used. If set to false, the HTTP client will use the default connection keep-alive strategy, which is to use only the server instructions (if any) set in the Keep-Alive response header. If set to true, the HTTP client will use a custom connection keep-alive strategy which uses the server instructions set in the Keep-Alive response header; if the response doesn't contain a Keep-Alive header, the client will use a default keep-alive period which is configurable via maxKeepAliveTime(Integer).
        Parameters:
        keepAlive - set to false to use a default keep-alive strategy or to true to use a custom one
        Returns:
        the builder instance
        See Also:
        maxKeepAliveTime(Integer), Keep-Alive
      • maxKeepAliveTime

        public HttpClientProperties.HttpClientPropertiesBuilder maxKeepAliveTime​(Integer maxKeepAliveTime)
        Sets the time a connection can remain idle as part of the keep-alive strategy. This value is only used if keepAlive(boolean) is set to true. Defaults to 120 seconds (2 minutes).
        Parameters:
        maxKeepAliveTime - the maximum time a connection may remain idle, expressed in seconds
        Returns:
        the builder instance
      • maxConnectionsTotal

        public HttpClientProperties.HttpClientPropertiesBuilder maxConnectionsTotal​(Integer maxConnectionsTotal)
        Sets the total maximum number of connections the client may keep open at the same time.
        Parameters:
        maxConnectionsTotal - the total maximum number of connections
        Returns:
        the builder instance
      • maxConnectionsPerRoute

        public HttpClientProperties.HttpClientPropertiesBuilder maxConnectionsPerRoute​(Integer maxConnections)
        Sets the maximum number of connections the client may keep open at the same time for the same route (endpoint).
        Parameters:
        maxConnections - the maximum number of connections per route
        Returns:
        the builder instance