[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| 
Re: [microprofile-dev] Question about priority order of Fault Tolerance annotations.
 | 
  
  
    
      Dear Emily-san
      
      Thank you so much for your reply and explanations.
      It seems that the @Timeout is the higher priority than @Retry and
      @CircuitBreaker.
      
      And yes, I assume that the spec is a little bit unclear for me to
      understand. (I may raise an issue after the conversation.)
      So could you let me know more detail with sample scenario?
      
      For example, if I wrote following code, how to behave?
    
    Senario 1
    
    ----------------------------------------------
      @Timeout(400)
      @Retry(6)
      @CircuitBreaker(successThreshold = 5, requestVolumeThreshold = 6,
      failureRatio=0.5, delay = 1000)
      @Bulkhead(5)
      @Fallback(fallbackMethod= "fallbackForServiceB")
      public void foo(){
      
      }
      
      Priority Order is following?
      ----------------
      1. Timeout (400ms)
      2. Retry
      
      3. Timeout (400ms)
      4. Retry
      
      5. Timeout (400ms)
      6. CircuitBreaker Open (requestVolumeThreshold * failureRatio)
      
      7. Retry
      8. Fallback (fallbackForServiceB method is invoked due to
      CircuitBreaker)
      ----------------
      
      How to check the Buildhead? (In the above scenario connection is
      one? (If @Asyncronous is added, is it counted as multiple
      request?)
      
    
    Thank you so much & Best Regards.
    Yoshio.
    
    On 2020/03/19 8:11, Emily Jiang wrote:
    
    
      
      
        Hi Yoshio,
        
        
        
        
        
        
        
        
          However I couldn't understand the priority between the
            above three 
            annotations(@Timeout, @Retry and @CircuitBreaker).
        
        
        
        Each Retry might trigger TimeOut and might count towards
          CircuitBreaker. 
        
        Spec says:
        
          If @Retry is used with @CircuitBreaker,
            each retry attempt is processed by the circuit breaker and
            recorded as either a success or a failure. If a CircuitBreakerOpenException
            is thrown, the execution may be retried, depending on how
            the @Retry is configured.
        
        
          
            If @Timeout is used with @Retry,
              a TimeoutException may trigger a retry,
              depending on the values of retryOn and abortOn
              of the @Retry annotation. The timeout is
              restarted for each retry. If @Asynchronous
              is also used and the retry is the result of a TimeoutException,
              the retry starts after any delay period, even if the
              original attempt is still running.
           
          
            If @Timeout is used with @CircuitBreaker,
              a TimeoutException may be counted as a
              failure by the circuit breaker and contribute towards
              opening the circuit, depending on the value of failOn
              on the @CircuitBreaker annotation.
           
           Please feel free to raise an issue (
https://github.com/eclipse/microprofile-fault-tolerance)
          on Fault Tolerance repo if you think the spec is unclear.
 
        
        
        Thanks
        Emily
        
        
        
        
        
         
       
      
      
        
        Dear
          my all friends.
          
          I would like to ask you one question about MicroProfile Fault
          Tolerance.
          Now I'm creating the explanation by Japanese as follows.
          https://dev.to/azure/microprofile-fault-tolerance-1a6g
          
          In fact, there is some annotations for Fault Tolerance and it
          is useful.
          
          According to the specification, "@Fallback" will be invoke
          after all of 
          the evaluation of other annotations like @Timeout, @Retry and
          
          @CircuitBreaker.
          
          However I couldn't understand the priority between the above
          three 
          annotations(@Timeout, @Retry and @CircuitBreaker).
          
          Is there a priority of the above three annotations?
          Or will it be evaluated individual by parallel?
          
          If it is possible, could you let me know the specification of
          the 
          priority order between the three annotations?
          
          Thank you so much & Best Regards.
          
          Yoshio.
          
          _______________________________________________
          microprofile-dev mailing list
          microprofile-dev@xxxxxxxxxxx
          To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/microprofile-dev
        
       
      
      
      -- 
      
      
      
      _______________________________________________
microprofile-dev mailing list
microprofile-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/microprofile-dev