🎨 wx-java-open-spring-boot-starter 增加重试次数配置

This commit is contained in:
Forever杨
2021-04-21 13:27:59 +08:00
committed by GitHub
parent 0a75b0e902
commit 3eabfedd9c
15 changed files with 201 additions and 59 deletions

View File

@ -172,6 +172,22 @@ public interface WxMpConfigStorage {
*/
String getHttpProxyPassword();
/**
* http 请求重试间隔
* <pre>
* {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setRetrySleepMillis(int)}
* </pre>
*/
int getRetrySleepMillis();
/**
* http 请求最大重试次数
* <pre>
* {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setMaxRetryTimes(int)}
* </pre>
*/
int getMaxRetryTimes();
/**
* Gets tmp dir file.
*

View File

@ -4,8 +4,8 @@ import lombok.Data;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.enums.TicketType;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.mp.config.WxMpHostConfig;
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
import me.chanjar.weixin.mp.config.WxMpHostConfig;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import java.io.File;
@ -37,6 +37,9 @@ public class WxMpDefaultConfigImpl implements WxMpConfigStorage, Serializable {
protected volatile String httpProxyUsername;
protected volatile String httpProxyPassword;
protected volatile int retrySleepMillis = 1000;
protected volatile int maxRetryTimes = 5;
protected volatile String jsapiTicket;
protected volatile long jsapiTicketExpiresTime;