8000 add mp host config & redis sentinel config by Dream2Land · Pull Request #1785 · binarywang/WxJava · GitHub
[go: up one dir, main page]

Skip to content

add mp host config & redis sentinel config #1785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
format spelling
format spelling
  • Loading branch information
Dream2Land committed Sep 27, 2020
commit 8a2e7ce605465ae8c7d436ccf594f15816b9a77b
10 changes: 5 additions & 5 deletions spring-boot-starters/wx-java-mp-spring-boot-starter/README.md
10000
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
wx.mp.config-storage.redis.host = 127.0.0.1
wx.mp.config-storage.redis.port = 6379
#单机和sentinel同时存在时,优先使用sentinel配置
#wx.mp.config-storage.redis.sentinelips=127.0.0.1:16379,127.0.0.1:26379
#wx.mp.config-storage.redis.sentinelname=mymaster
#wx.mp.config-storage.redis.sentinel-ips=127.0.0.1:16379,127.0.0.1:26379
#wx.mp.config-storage.redis.sentinel-name=mymaster
# http客户端配置
wx.mp.config-storage.http-client-type=httpclient # http客户端类型: HttpClient(默认), OkHttp, JoddHttp
wx.mp.config-storage.http-proxy-host=
wx.mp.config-storage.http-proxy-port=
wx.mp.config-storage.http-proxy-username=
wx.mp.config-storage.http-proxy-password=
# 公众号地址host配置
#wx.mp.hosts.apihost=http://proxy.com/
#wx.mp.hosts.openhost=http://proxy.com/
#wx.mp.hosts.mphost=http://proxy.com/
#wx.mp.hosts.api-host=http://proxy.com/
#wx.mp.hosts.open-host=http://proxy.com/
#wx.mp.hosts.mp-host=http://proxy.com/
```
3. 自动注入的类型
- `WxMpService`以及~~相关的服务类, 比如: `wxMpService.getXxxService`。~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public WxMpConfigStorage wxMpConfigStorage() {
break;
}
// wx host config
if (null != wxMpProperties.getHosts() && StringUtils.isNotEmpty(wxMpProperties.getHosts().getApihost())) {
if (null != wxMpProperties.getHosts() && StringUtils.isNotEmpty(wxMpProperties.getHosts().getApiHost())) {
WxMpHostConfig hostConfig = new WxMpHostConfig();
hostConfig.setApiHost(wxMpProperties.getHosts().getApihost());
hostConfig.setMpHost(wxMpProperties.getHosts().getMphost());
hostConfig.setOpenHost(wxMpProperties.getHosts().getOpenhost());
hostConfig.setApiHost(wxMpProperties.getHosts().getApiHost());
hostConfig.setMpHost(wxMpProperties.getHosts().getMpHost());
hostConfig.setOpenHost(wxMpProperties.getHosts().getOpenHost());
config.setHostConfig(hostConfig);
}
return config;
Expand Down Expand Up @@ -137,9 +137,9 @@ private JedisPoolAbstract getJedisPool() {
}
config.setTestOnBorrow(true);
config.setTestWhileIdle(true);
if (StringUtils.isNotEmpty(redis.getSentinelips())) {
Set<String> sentinels = Sets.newHashSet(redis.getSentinelips().split(","));
return new JedisSentinelPool(redis.getSentinelname(), sentinels);
if (StringUtils.isNotEmpty(redis.getSentinelIps())) {
Set<String> sentinels = Sets.newHashSet(redis.getSentinelIps().split(","));
return new JedisSentinelPool(redis.getSentinelName(), sentinels);
}

return new JedisPool(config, redis.getHost(), redis.getPort(), redis.getTimeout(), redis.getPassword(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public class HostConfig implements Serializable {

private static final long serialVersionUID = -4172767630740346001L;

private String apihost;
private String apiHost;

private String openhost;
private String openHost;

private String mphost;
private String mpHost;

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public class RedisProperties implements Serializable {
/**
* sentinel ips
*/
private String sentinelips;
private String sentinelIps;

/**
* sentinel name
*/
private String sentinelname;
private String sentinelName;

private Integer maxActive;
private Integer maxIdle;
Expand Down
0