public class RetryProperty extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private boolean |
enableGlobalRetry
是否启用全局重试,启用的话,所有HTTP请求都会自动重试。
|
private int |
globalIntervalMs
全局重试时间间隔
Retry interval
|
private int |
globalMaxRetries
全局最大重试次数,最大可设置为100
The maximum number of retries, the maximum can be set to 100
|
private RetryRule[] |
globalRetryRules
重试规则,默认 响应状态码不是2xx 或者 发生IO异常 时触发重试
Retry rule
|
private Class<? extends BaseRetryInterceptor> |
retryInterceptor
retry interceptor
|
| 构造器和说明 |
|---|
RetryProperty() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getGlobalIntervalMs() |
int |
getGlobalMaxRetries() |
RetryRule[] |
getGlobalRetryRules() |
Class<? extends BaseRetryInterceptor> |
getRetryInterceptor() |
boolean |
isEnableGlobalRetry() |
void |
setEnableGlobalRetry(boolean enableGlobalRetry) |
void |
setGlobalIntervalMs(int globalIntervalMs) |
void |
setGlobalMaxRetries(int globalMaxRetries) |
void |
setGlobalRetryRules(RetryRule[] globalRetryRules) |
void |
setRetryInterceptor(Class<? extends BaseRetryInterceptor> retryInterceptor) |
private boolean enableGlobalRetry
Retry标注的接口才会执行重试。
接口上Retry注解属性优先于全局配置。private int globalMaxRetries
private int globalIntervalMs
private RetryRule[] globalRetryRules
private Class<? extends BaseRetryInterceptor> retryInterceptor
public boolean isEnableGlobalRetry()
public void setEnableGlobalRetry(boolean enableGlobalRetry)
public int getGlobalMaxRetries()
public void setGlobalMaxRetries(int globalMaxRetries)
public int getGlobalIntervalMs()
public void setGlobalIntervalMs(int globalIntervalMs)
public RetryRule[] getGlobalRetryRules()
public void setGlobalRetryRules(RetryRule[] globalRetryRules)
public Class<? extends BaseRetryInterceptor> getRetryInterceptor()
public void setRetryInterceptor(Class<? extends BaseRetryInterceptor> retryInterceptor)
Copyright © 2021. All rights reserved.