Class LeastResponseTimeConfiguration

  • All Implemented Interfaces:
    ConfigWithType

    public class LeastResponseTimeConfiguration
    extends Object
    implements ConfigWithType
    Configuration for the LeastResponseTimeLoadBalancerProvider LoadBalancer.
    • Constructor Detail

      • LeastResponseTimeConfiguration

        public LeastResponseTimeConfiguration​(Map<String,​String> params)
        Creates a new LeastResponseTimeConfiguration
        Parameters:
        params - the parameters, must not be null
      • LeastResponseTimeConfiguration

        public LeastResponseTimeConfiguration()
        Creates a new LeastResponseTimeConfiguration
    • Method Detail

      • getDecliningFactor

        public String getDecliningFactor()
        How much *score* should decline in time, see Score calculation in the docs for details. By default: 0.9
        Returns:
        the configured declining-factor, 0.9 if not set
      • withDecliningFactor

        public LeastResponseTimeConfiguration withDecliningFactor​(String value)
        Set the 'declining-factor' attribute. Default is 0.9.
        Parameters:
        value - the value for declining-factor
        Returns:
        the current LeastResponseTimeConfiguration to chain calls
      • getErrorPenalty

        public String getErrorPenalty()
        This load balancer treats an erroneous response as a response after this time. By default: 60s
        Returns:
        the configured error-penalty, 60s if not set
      • withErrorPenalty

        public LeastResponseTimeConfiguration withErrorPenalty​(String value)
        Set the 'error-penalty' attribute. Default is 60s.
        Parameters:
        value - the value for error-penalty
        Returns:
        the current LeastResponseTimeConfiguration to chain calls
      • getUseSecureRandom

        public String getUseSecureRandom()
        Whether the load balancer should use a SecureRandom instead of a Random (default). Check [this page](https://stackoverflow.com/questions/11051205/difference-between-java-util-random-and-java-security-securerandom) to understand the difference By default: false
        Returns:
        the configured use-secure-random, false if not set
      • withUseSecureRandom

        public LeastResponseTimeConfiguration withUseSecureRandom​(String value)
        Set the 'use-secure-random' attribute. Default is false.
        Parameters:
        value - the value for use-secure-random
        Returns:
        the current LeastResponseTimeConfiguration to chain calls