Package com.alibaba.dashscope.transport
Class RetryInterceptor
java.lang.Object
com.alibaba.dashscope.transport.RetryInterceptor
- All Implemented Interfaces:
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 -
Method Summary
-
Constructor Details
-
RetryInterceptor
public RetryInterceptor()
-
-
Method Details
-
intercept
- Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-