Class ThreadPoolBulkheadConfig.Builder

  • Enclosing class:
    ThreadPoolBulkheadConfig

    public static class ThreadPoolBulkheadConfig.Builder
    extends java.lang.Object
    • Method Detail

      • maxThreadPoolSize

        public ThreadPoolBulkheadConfig.Builder maxThreadPoolSize​(int maxThreadPoolSize)
        Configures the max thread pool size.
        Parameters:
        maxThreadPoolSize - max thread pool size
        Returns:
        the BulkheadConfig.Builder
      • coreThreadPoolSize

        public ThreadPoolBulkheadConfig.Builder coreThreadPoolSize​(int coreThreadPoolSize)
        Configures the core thread pool size.
        Parameters:
        coreThreadPoolSize - core thread pool size
        Returns:
        the BulkheadConfig.Builder
      • contextPropagator

        public final ThreadPoolBulkheadConfig.Builder contextPropagator​(@Nullable
                                                                        java.lang.Class<? extends ContextPropagator>... contextPropagatorClasses)
        Configures the context propagator class.
        Returns:
        the BulkheadConfig.Builder
      • queueCapacity

        public ThreadPoolBulkheadConfig.Builder queueCapacity​(int queueCapacity)
        Configures the capacity of the queue.
        Parameters:
        queueCapacity - max concurrent calls
        Returns:
        the BulkheadConfig.Builder
      • keepAliveDuration

        public ThreadPoolBulkheadConfig.Builder keepAliveDuration​(java.time.Duration keepAliveDuration)
        When the number of threads is greater than the core, this is the maximum time duration that excess idle threads will wait for new tasks before terminating.
        Parameters:
        keepAliveDuration - maximum wait duration for bulkhead thread pool idle thread
        Returns:
        the BulkheadConfig.Builder
      • writableStackTraceEnabled

        public ThreadPoolBulkheadConfig.Builder writableStackTraceEnabled​(boolean writableStackTraceEnabled)
        Enables writable stack traces. When set to false, Throwable.getStackTrace() returns a zero length array. This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already known (the circuit breaker is short-circuiting calls).
        Parameters:
        writableStackTraceEnabled - flag to control if stack trace is writable
        Returns:
        the BulkheadConfig.Builder