Class RetryInterceptor

java.lang.Object
com.alibaba.dashscope.transport.RetryInterceptor
All Implemented Interfaces:
okhttp3.Interceptor

public final class RetryInterceptor extends Object implements okhttp3.Interceptor
Application-level retry policy (design §6):
  • retryable statuses {408, 409, 429, 500, 502, 503, 504} plus connection-level IO failures
  • honors Retry-After / Retry-After-ms / X-Should-Retry
  • exponential backoff 500ms → 8s with ±25% jitter
  • default maxRetries=2 (per-request override via RequestTags.MaxRetries)
  • requests tagged RequestTags.NoRetry (SSE / WebSocket upgrade) are never retried: a failed stream cannot be safely replayed (double billing / duplicated results)
  • Nested Class Summary

    Nested classes/interfaces inherited from interface okhttp3.Interceptor

    okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion
  • Field Summary

    Fields inherited from interface okhttp3.Interceptor

    Companion
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    okhttp3.Response
    intercept(okhttp3.Interceptor.Chain chain)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RetryInterceptor

      public RetryInterceptor()
  • Method Details

    • intercept

      public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException
      Specified by:
      intercept in interface okhttp3.Interceptor
      Throws:
      IOException