Packages

t

uk.gov.hmrc.circuitbreaker

UsingCircuitBreaker

trait UsingCircuitBreaker extends AnyRef

Trait to be mixed in to services or connectors that wish to protect their outgoing calls from wasting unsuccessful invocations in periods where the service seems to be unavailable.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UsingCircuitBreaker
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def breakOnException(t: Throwable): Boolean

    Predicate that defines the exceptions that should be treated as a failure.

    Predicate that defines the exceptions that should be treated as a failure. In most cases only 5xx status responses should be treated as a server-side issue.

    Attributes
    protected
  2. abstract def circuitBreakerConfig: CircuitBreakerConfig

    The configuration for the circuit breaker:

    The configuration for the circuit breaker:

    - serviceName - the name of the service - numberOfCallsToTriggerStateChange - the number of failed calls that need to accumulate within unstablePeriodDuration for the service to get disabled, as well as the number of successful calls that are needed to get a service back from the disabled state to normal. - unavailablePeriodDuration - the time in seconds that a service should be disabled in case it accumulated more than the configured maximum number of failures - unstablePeriodDuration - the time in seconds that failure counts are accumulated. When the period ends without reaching the limit, the counter switches back to 0.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. lazy val circuitBreaker: CircuitBreaker

    The CircuitBreaker instance used by this trait.

    The CircuitBreaker instance used by this trait.

    Attributes
    protected
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def isServiceAvailable: Boolean

    Indicates whether the service is available.

    Indicates whether the service is available. Returns false if the service is disabled due to accumulating too many failures in the configured time frame. Note that due to the asynchronous nature of the circuit breaker, you can still get an UnhealthyServiceException after this method returned true as the state might change any time.

    Attributes
    protected
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. def withCircuitBreaker[T](f: => Future[T])(implicit hc: HeaderCarrier): Future[T]

    Protects the specified future from being evaluated in case the service is disabled due to accumulating too many failures in the configured time frame.

    Protects the specified future from being evaluated in case the service is disabled due to accumulating too many failures in the configured time frame. If the service is disabled, the future will fail with a UnhealthyServiceException, if it is enabled, it will succeed or fail with whatever result the original future produces.

    Attributes
    protected

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped