Annotation Type CircuitBreaker


  • @Retention(RUNTIME)
    @Target({METHOD,TYPE})
    @Documented
    public @interface CircuitBreaker
    This annotation can be applied to a class or a specific method. Applying it on a class is equivalent to applying it on all its public methods. The annotation enables backend monitoring for all methods where it is applied. Backend monitoring is performed via a circuit breaker. See CircuitBreaker for details. If using Spring, name and fallbackMethod can be resolved using Spring Expression Language (SpEL).
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String name
      Name of the circuit breaker.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String fallbackMethod
      fallbackMethod method name.
    • Element Detail

      • name

        java.lang.String name
        Name of the circuit breaker. It can be SpEL expression. If you want to use first parameter of the method as name, you can express it #root.args[0], #p0 or #a0. And method name can be accessed via #root.methodName
        Returns:
        the name of the circuit breaker
      • fallbackMethod

        java.lang.String fallbackMethod
        fallbackMethod method name.
        Returns:
        fallbackMethod method name.
        Default:
        ""