mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-29 01:18:36 +08:00
🎨 wx-java-open-spring-boot-starter 增加重试次数配置
This commit is contained in:
@ -205,6 +205,22 @@ public interface WxMaConfig {
|
||||
*/
|
||||
String getHttpProxyPassword();
|
||||
|
||||
/**
|
||||
* http 请求重试间隔
|
||||
* <pre>
|
||||
* {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setRetrySleepMillis(int)}
|
||||
* </pre>
|
||||
*/
|
||||
int getRetrySleepMillis();
|
||||
|
||||
/**
|
||||
* http 请求最大重试次数
|
||||
* <pre>
|
||||
* {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setMaxRetryTimes(int)}
|
||||
* </pre>
|
||||
*/
|
||||
int getMaxRetryTimes();
|
||||
|
||||
/**
|
||||
* http client builder
|
||||
*
|
||||
@ -231,7 +247,7 @@ public interface WxMaConfig {
|
||||
* 获取自定义的apiHost地址,用于替换原请求中的https://api.weixin.qq.com
|
||||
* 具体取值,可以参考https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Interface_field_description.html
|
||||
*
|
||||
* @return 自定义的api域名地址
|
||||
* @return 自定义的api域名地址
|
||||
*/
|
||||
String getApiHostUrl();
|
||||
}
|
||||
|
||||
@ -41,6 +41,10 @@ public class WxMaDefaultConfigImpl implements WxMaConfig {
|
||||
private volatile int httpProxyPort;
|
||||
private volatile String httpProxyUsername;
|
||||
private volatile String httpProxyPassword;
|
||||
|
||||
private volatile int retrySleepMillis = 1000;
|
||||
private volatile int maxRetryTimes = 5;
|
||||
|
||||
private volatile String jsapiTicket;
|
||||
private volatile long jsapiTicketExpiresTime;
|
||||
/**
|
||||
@ -257,6 +261,24 @@ public class WxMaDefaultConfigImpl implements WxMaConfig {
|
||||
this.httpProxyPassword = httpProxyPassword;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRetrySleepMillis() {
|
||||
return this.retrySleepMillis;
|
||||
}
|
||||
|
||||
public void setRetrySleepMillis(int retrySleepMillis) {
|
||||
this.retrySleepMillis = retrySleepMillis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxRetryTimes() {
|
||||
return this.maxRetryTimes;
|
||||
}
|
||||
|
||||
public void setMaxRetryTimes(int maxRetryTimes) {
|
||||
this.maxRetryTimes = maxRetryTimes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMaGsonBuilder.create().toJson(this);
|
||||
|
||||
Reference in New Issue
Block a user