Merge pull request #13 from zhong-jie/feature/integrating-nacos
Feature/integrating nacos
This commit is contained in:
20
README.md
20
README.md
@@ -66,6 +66,7 @@ A Managerment API Gateway in Java . Fizz Gateway 是一个基于 Java开发的
|
|||||||
| v1.0.0 | v1.0.0 | v1.0.0 |
|
| v1.0.0 | v1.0.0 | v1.0.0 |
|
||||||
| v1.1.0 | v1.1.0 | v1.1.0 |
|
| v1.1.0 | v1.1.0 | v1.1.0 |
|
||||||
| v1.1.1 | v1.1.1 | v1.1.1 |
|
| v1.1.1 | v1.1.1 | v1.1.1 |
|
||||||
|
| v1.2.0 | v1.2.0 | v1.1.1 |
|
||||||
|
|
||||||
请根据社区版的版本下载对应的管理后台版本
|
请根据社区版的版本下载对应的管理后台版本
|
||||||
|
|
||||||
@@ -93,13 +94,13 @@ A Managerment API Gateway in Java . Fizz Gateway 是一个基于 Java开发的
|
|||||||
|
|
||||||
##### 管理后台服务端(fizz-manager-professional)
|
##### 管理后台服务端(fizz-manager-professional)
|
||||||
|
|
||||||
1. 首次安装执行`fizz-manager-professional-1.1.1-mysql.sql`数据库脚本
|
1. 首次安装执行`fizz-manager-professional-1.2.0-mysql.sql`数据库脚本
|
||||||
2. 将`application-prod.yml`、`boot.sh`、`fizz-manager-professional-1.1.1.jar`拷贝到`/data/webapps/fizz-manager-professional`目录下
|
2. 将`application-prod.yml`、`boot.sh`、`fizz-manager-professional-1.2.0.jar`拷贝到`/data/webapps/fizz-manager-professional`目录下
|
||||||
3. 修改`application-prod.yml`文件,将相关配置修改成部署环境的配置
|
3. 修改`application-prod.yml`文件,将相关配置修改成部署环境的配置
|
||||||
4. 修改`boot.sh`文件,将`RUN_CMD`变量值修改成部署环境的JAVA实际路径
|
4. 修改`boot.sh`文件,将`RUN_CMD`变量值修改成部署环境的JAVA实际路径
|
||||||
5. 执行 `chmod +x boot.sh` 命令给`boot.sh`增加执行权限
|
5. 执行 `chmod +x boot.sh` 命令给`boot.sh`增加执行权限
|
||||||
6. 执行 `./boot.sh start` 命令启动服务,支持 start/stop/restart/status命令
|
6. 执行 `./boot.sh start` 命令启动服务,支持 start/stop/restart/status命令
|
||||||
7. 服务启动后访问 http://IP:8000/fizz-manager (将IP替换成服务部署机器IP地址),使用超级管理员账户`admin`密码`Aa123!`登录
|
7. 服务启动后访问前端登录地址,使用超级管理员账户`admin`密码`Aa123!`登录
|
||||||
|
|
||||||
##### 管理后台前端(fizz-admin-professional)
|
##### 管理后台前端(fizz-admin-professional)
|
||||||
|
|
||||||
@@ -126,11 +127,14 @@ server {
|
|||||||
|
|
||||||
#### 二、安装fizz-gateway-community社区版
|
#### 二、安装fizz-gateway-community社区版
|
||||||
|
|
||||||
说明:如果使用apollo配置中心,可把application.yml文件内容迁到配置中心(apollo上应用名为:fizz-gateway);使用不使用apollo可去掉下面启动命令里的apollo参数。
|
说明:
|
||||||
|
|
||||||
|
1. 支持配置中心:apollo、nacos,支持注册中心:eureka、nacos,详细配置方法查看application.yml文件。
|
||||||
|
2. 如果使用apollo配置中心,可把application.yml文件内容迁到配置中心(apollo上应用名为:fizz-gateway);如果不使用apollo可去掉下面启动命令里的apollo参数。
|
||||||
|
|
||||||
安装方式一:脚本启动:
|
安装方式一:脚本启动:
|
||||||
|
|
||||||
1. 下载fizz-gateway-community的最新代码,修改application.yml配置文件里eureka、redis的配置,使用maven命令`mvn clean package -DskipTests=true`构建并把构建好的fizz-gateway-community-1.1.1.jar和boot.sh放同一目录
|
1. 下载fizz-gateway-community的最新代码,修改application.yml配置文件里配置中心、注册中心、redis的配置,使用maven命令`mvn clean package -DskipTests=true`构建并把构建好的fizz-gateway-community-1.2.0.jar和boot.sh放同一目录
|
||||||
2. 修改boot.sh脚本的apollo连接,JVM内存配置
|
2. 修改boot.sh脚本的apollo连接,JVM内存配置
|
||||||
3. 执行 `./boot.sh start` 命令启动服务,支持 start/stop/restart/status命令
|
3. 执行 `./boot.sh start` 命令启动服务,支持 start/stop/restart/status命令
|
||||||
|
|
||||||
@@ -138,13 +142,13 @@ server {
|
|||||||
|
|
||||||
1. 本地clone仓库上的最新代码
|
1. 本地clone仓库上的最新代码
|
||||||
2. 将项目fizz-gateway导入IDE
|
2. 将项目fizz-gateway导入IDE
|
||||||
3. 导入完成后设置项目启动配置及修改application.yml配置文件里eureka、redis的配置,在VM选项中加入`-Denv=dev -Dapollo.meta=http://localhost:66`(Apollo配置中心地址)
|
3. 导入完成后设置项目启动配置及修改application.yml配置文件里配置中心、注册中心、redis的配置,在VM选项中加入`-Denv=dev -Dapollo.meta=http://localhost:66`(Apollo配置中心地址)
|
||||||
|
|
||||||
安装方式三:jar启动:
|
安装方式三:jar启动:
|
||||||
|
|
||||||
1. 本地clone仓库上的最新代码,修改application.yml配置文件里eureka、redis的配置
|
1. 本地clone仓库上的最新代码,修改application.yml配置文件里配置中心、注册中心、redis的配置
|
||||||
2. 在项目根目录fizz-gateway-community下执行Maven命令`mvn clean package -DskipTests=true`打包
|
2. 在项目根目录fizz-gateway-community下执行Maven命令`mvn clean package -DskipTests=true`打包
|
||||||
3. 进入target目录,使用命令`java -jar -Denv=DEV -Dapollo.meta=http://localhost:66 fizz-gateway-community-1.1.1.jar`启动服务
|
3. 进入target目录,使用命令`java -jar -Denv=DEV -Dapollo.meta=http://localhost:66 fizz-gateway-community-1.2.0.jar`启动服务
|
||||||
|
|
||||||
最后访问网关,地址形式为:http://127.0.0.1:8600/proxy/[服务名]/[API Path]
|
最后访问网关,地址形式为:http://127.0.0.1:8600/proxy/[服务名]/[API Path]
|
||||||
|
|
||||||
|
|||||||
1
docs/CNAME
Normal file
1
docs/CNAME
Normal file
@@ -0,0 +1 @@
|
|||||||
|
fizzgate.com
|
||||||
14
pom.xml
14
pom.xml
@@ -10,7 +10,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
<groupId>we</groupId>
|
<groupId>we</groupId>
|
||||||
<artifactId>fizz-gateway-community</artifactId>
|
<artifactId>fizz-gateway-community</artifactId>
|
||||||
<version>1.1.1</version>
|
<version>1.2.0</version>
|
||||||
<name>fizz-gateway-community</name>
|
<name>fizz-gateway-community</name>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
<log4j2.version>2.13.3</log4j2.version>
|
<log4j2.version>2.13.3</log4j2.version>
|
||||||
<netty.version>4.1.53.Final</netty.version>
|
<netty.version>4.1.53.Final</netty.version>
|
||||||
<httpclient.version>4.5.13</httpclient.version>
|
<httpclient.version>4.5.13</httpclient.version>
|
||||||
|
<nacos.version>0.2.7</nacos.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -148,6 +149,17 @@
|
|||||||
<version>2.2.5.RELEASE</version>
|
<version>2.2.5.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.boot</groupId>
|
||||||
|
<artifactId>nacos-config-spring-boot-starter</artifactId>
|
||||||
|
<version>${nacos.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.boot</groupId>
|
||||||
|
<artifactId>nacos-discovery-spring-boot-starter</artifactId>
|
||||||
|
<version>${nacos.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-pool2</artifactId>
|
<artifactId>commons-pool2</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ cd `dirname $0`
|
|||||||
#变量定义
|
#变量定义
|
||||||
APOLLO_META_SERVER=http://localhost:66
|
APOLLO_META_SERVER=http://localhost:66
|
||||||
ENV=dev
|
ENV=dev
|
||||||
APP_NAME=fizz-gateway-community-1.1.1.jar
|
APP_NAME=fizz-gateway-community-1.2.0.jar
|
||||||
APP_DEP_DIR=/data/webapps/fizz-gateway
|
APP_DEP_DIR=/data/webapps/fizz-gateway
|
||||||
APP_LOG_DIR=/data/logs/fizz-gateway
|
APP_LOG_DIR=/data/logs/fizz-gateway
|
||||||
JAVA_CMD=/usr/local/java/bin/java
|
JAVA_CMD=/usr/local/java/bin/java
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package we;
|
package we;
|
||||||
|
|
||||||
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
|
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
|
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
|
||||||
@@ -12,7 +12,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|||||||
exclude = {ErrorWebFluxAutoConfiguration.class, RedisAutoConfiguration.class, RedisReactiveAutoConfiguration.class},
|
exclude = {ErrorWebFluxAutoConfiguration.class, RedisAutoConfiguration.class, RedisReactiveAutoConfiguration.class},
|
||||||
scanBasePackages = {"we"}
|
scanBasePackages = {"we"}
|
||||||
)
|
)
|
||||||
@EnableApolloConfig
|
@NacosPropertySource(dataId = "application", groupId = "fizz-gateway", autoRefreshed = true)
|
||||||
@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
public class FizzGatewayApplication {
|
public class FizzGatewayApplication {
|
||||||
|
|
||||||
|
|||||||
15
src/main/java/we/config/ApolloConfig.java
Normal file
15
src/main/java/we/config/ApolloConfig.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package we.config;
|
||||||
|
|
||||||
|
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apollo config
|
||||||
|
* @author zhongjie
|
||||||
|
*/
|
||||||
|
@ConditionalOnProperty(name = "apollo.enabled")
|
||||||
|
@EnableApolloConfig
|
||||||
|
@Configuration
|
||||||
|
public class ApolloConfig {
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package we.config;
|
package we.config;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.api.config.annotation.NacosValue;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class AppConfigProperties {
|
public class AppConfigProperties {
|
||||||
|
|
||||||
|
@NacosValue(value = "${spring.profiles.active}", autoRefreshed = true)
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String env;
|
private String env;
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,12 @@
|
|||||||
|
|
||||||
package we.config;
|
package we.config;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.api.config.annotation.NacosValue;
|
||||||
import com.ctrip.framework.apollo.model.ConfigChange;
|
import com.ctrip.framework.apollo.model.ConfigChange;
|
||||||
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
|
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
|
||||||
import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
|
import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
|
||||||
|
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
import we.plugin.auth.GatewayGroup;
|
import we.plugin.auth.GatewayGroup;
|
||||||
import we.util.Constants;
|
import we.util.Constants;
|
||||||
import we.util.JacksonUtils;
|
import we.util.JacksonUtils;
|
||||||
@@ -61,6 +63,7 @@ public class SystemConfig {
|
|||||||
//
|
//
|
||||||
// private Set<Character> currentServerGatewayGroupSet;
|
// private Set<Character> currentServerGatewayGroupSet;
|
||||||
|
|
||||||
|
@NacosValue(value = "${spring.profiles.active}")
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@@ -140,11 +143,9 @@ public class SystemConfig {
|
|||||||
String nv = c.getNewValue();
|
String nv = c.getNewValue();
|
||||||
log.info(p + " old: " + ov + ", new: " + nv);
|
log.info(p + " old: " + ov + ", new: " + nv);
|
||||||
if (p.equals("log.response-body")) {
|
if (p.equals("log.response-body")) {
|
||||||
logResponseBody = Boolean.valueOf(nv);
|
this.updateLogResponseBody(Boolean.parseBoolean(nv));
|
||||||
afterLogResponseBodySet();
|
|
||||||
} else if (p.equals("log.headers")) {
|
} else if (p.equals("log.headers")) {
|
||||||
logHeaders = nv;
|
this.updateLogHeaders(nv);
|
||||||
afterLogHeadersSet();
|
|
||||||
} /*else if (p.equals("gateway-group")) {
|
} /*else if (p.equals("gateway-group")) {
|
||||||
gatewayGroup = nv;
|
gatewayGroup = nv;
|
||||||
afterGatewayGroupSet();
|
afterGatewayGroupSet();
|
||||||
@@ -152,4 +153,32 @@ public class SystemConfig {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateLogResponseBody(boolean newValue) {
|
||||||
|
logResponseBody = newValue;
|
||||||
|
this.afterLogResponseBodySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateLogHeaders(String newValue) {
|
||||||
|
logHeaders = newValue;
|
||||||
|
afterLogHeadersSet();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NacosValue(value = "${log.response-body:false}", autoRefreshed = true)
|
||||||
|
public void setLogResponseBody(boolean logResponseBody) {
|
||||||
|
if (this.logResponseBody == logResponseBody) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log.info("log.response-body old: " + this.logResponseBody + ", new: " + logResponseBody);
|
||||||
|
this.updateLogResponseBody(logResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NacosValue(value = "${log.headers:x}", autoRefreshed = true)
|
||||||
|
public void setLogHeaders(String logHeaders) {
|
||||||
|
if (ObjectUtils.nullSafeEquals(this.logHeaders, logHeaders)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log.info("log.headers old: " + this.logHeaders + ", new: " + logHeaders);
|
||||||
|
this.updateLogHeaders(logHeaders);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package we.controller;
|
package we.controller;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.api.config.annotation.NacosValue;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -44,6 +45,7 @@ import java.util.stream.Collectors;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "/managerConfig")
|
@RequestMapping(value = "/managerConfig")
|
||||||
public class ManagerConfigController {
|
public class ManagerConfigController {
|
||||||
|
@NacosValue(value = "${fizz.manager.config.key:fizz-manager-key}", autoRefreshed = true)
|
||||||
@Value("${fizz.manager.config.key:fizz-manager-key}")
|
@Value("${fizz.manager.config.key:fizz-manager-key}")
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package we.filter;
|
package we.filter;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.api.config.annotation.NacosValue;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -56,9 +57,11 @@ public class PreFilter extends ProxyAggrFilter {
|
|||||||
|
|
||||||
private static final FilterResult succFr = FilterResult.SUCCESS(PRE_FILTER);
|
private static final FilterResult succFr = FilterResult.SUCCESS(PRE_FILTER);
|
||||||
|
|
||||||
|
@NacosValue(value = "${spring.profiles.active}")
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
|
@NacosValue(value = "${b-services:x}")
|
||||||
@Value("${b-services:x}")
|
@Value("${b-services:x}")
|
||||||
private Set<String> bServices = new HashSet<>();
|
private Set<String> bServices = new HashSet<>();
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package we.fizz;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.api.config.annotation.NacosValue;
|
||||||
import we.config.AppConfigProperties;
|
import we.config.AppConfigProperties;
|
||||||
import we.fizz.input.ClientInputConfig;
|
import we.fizz.input.ClientInputConfig;
|
||||||
import we.fizz.input.Input;
|
import we.fizz.input.Input;
|
||||||
@@ -69,6 +70,7 @@ public class ConfigLoader {
|
|||||||
@Resource(name = AGGREGATE_REACTIVE_REDIS_TEMPLATE)
|
@Resource(name = AGGREGATE_REACTIVE_REDIS_TEMPLATE)
|
||||||
private ReactiveStringRedisTemplate reactiveStringRedisTemplate;
|
private ReactiveStringRedisTemplate reactiveStringRedisTemplate;
|
||||||
|
|
||||||
|
@NacosValue(value = "${fizz.aggregate.read-local-config-flag:false}", autoRefreshed = true)
|
||||||
@Value("${fizz.aggregate.read-local-config-flag:false}")
|
@Value("${fizz.aggregate.read-local-config-flag:false}")
|
||||||
private Boolean readLocalConfigFlag;
|
private Boolean readLocalConfigFlag;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.ctrip.framework.apollo.core.utils.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import we.constants.CommonConstants;
|
import we.constants.CommonConstants;
|
||||||
import we.exception.StopAndResponseException;
|
import we.exception.StopAndResponseException;
|
||||||
@@ -57,7 +57,7 @@ public class ScriptHelper {
|
|||||||
Script script = new Script();
|
Script script = new Script();
|
||||||
script.setType((String) scriptCfg.get("type"));
|
script.setType((String) scriptCfg.get("type"));
|
||||||
script.setSource((String) scriptCfg.get("source"));
|
script.setSource((String) scriptCfg.get("source"));
|
||||||
if (StringUtils.isBlank(script.getType()) || StringUtils.isBlank(script.getSource())) {
|
if (!StringUtils.hasText(script.getType()) || !StringUtils.hasText(script.getSource())) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package we.plugin.auth;
|
package we.plugin.auth;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.api.config.annotation.NacosValue;
|
||||||
import com.ctrip.framework.apollo.model.ConfigChange;
|
import com.ctrip.framework.apollo.model.ConfigChange;
|
||||||
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
|
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
|
||||||
import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
|
import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
|
||||||
@@ -30,6 +31,7 @@ import org.springframework.http.HttpHeaders;
|
|||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
@@ -75,13 +77,26 @@ public class ApiConfigService {
|
|||||||
k -> {
|
k -> {
|
||||||
ConfigChange cc = cce.getChange(k);
|
ConfigChange cc = cce.getChange(k);
|
||||||
if (cc.getPropertyName().equalsIgnoreCase("serviceWhiteList")) {
|
if (cc.getPropertyName().equalsIgnoreCase("serviceWhiteList")) {
|
||||||
log.info("old service white list: " + cc.getOldValue());
|
this.updateServiceWhiteList(cc.getOldValue(), cc.getNewValue());
|
||||||
serviceWhiteList = cc.getNewValue();
|
|
||||||
afterServiceWhiteListSet();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateServiceWhiteList(String oldValue, String newValue) {
|
||||||
|
if (ObjectUtils.nullSafeEquals(oldValue, newValue)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log.info("old service white list: " + oldValue);
|
||||||
|
serviceWhiteList = newValue;
|
||||||
|
afterServiceWhiteListSet();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NacosValue(value = "${serviceWhiteList:x}", autoRefreshed = true)
|
||||||
|
public void setServiceWhiteList(String serviceWhiteList) {
|
||||||
|
this.updateServiceWhiteList(this.serviceWhiteList, serviceWhiteList);
|
||||||
|
}
|
||||||
|
|
||||||
public void afterServiceWhiteListSet() {
|
public void afterServiceWhiteListSet() {
|
||||||
if (StringUtils.isNotBlank(serviceWhiteList)) {
|
if (StringUtils.isNotBlank(serviceWhiteList)) {
|
||||||
whiteListSet.clear();
|
whiteListSet.clear();
|
||||||
@@ -94,6 +109,7 @@ public class ApiConfigService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NacosValue(value = "${auth.compatible-wh:false}", autoRefreshed = true)
|
||||||
@Value("${auth.compatible-wh:false}")
|
@Value("${auth.compatible-wh:false}")
|
||||||
private boolean compatibleWh;
|
private boolean compatibleWh;
|
||||||
|
|
||||||
@@ -109,6 +125,7 @@ public class ApiConfigService {
|
|||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private CustomAuth customAuth;
|
private CustomAuth customAuth;
|
||||||
|
|
||||||
|
@NacosValue(value = "${openServiceWhiteList:false}", autoRefreshed = true)
|
||||||
@Value("${openServiceWhiteList:false}")
|
@Value("${openServiceWhiteList:false}")
|
||||||
private boolean openServiceWhiteList = false;
|
private boolean openServiceWhiteList = false;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package we.plugin.stat;
|
package we.plugin.stat;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.api.config.annotation.NacosValue;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -63,12 +64,15 @@ public class StatPluginFilter extends PluginFilter {
|
|||||||
|
|
||||||
private static final String reqTime = "\"reqTime\":";
|
private static final String reqTime = "\"reqTime\":";
|
||||||
|
|
||||||
|
@NacosValue(value = "${stat.open:false}", autoRefreshed = true)
|
||||||
@Value("${stat.open:false}")
|
@Value("${stat.open:false}")
|
||||||
private boolean statOpen = false;
|
private boolean statOpen = false;
|
||||||
|
|
||||||
|
@NacosValue(value = "${stat.channel:fizz_access_stat}", autoRefreshed = true)
|
||||||
@Value("${stat.channel:fizz_access_stat}")
|
@Value("${stat.channel:fizz_access_stat}")
|
||||||
private String fizzAccessStatChannel;
|
private String fizzAccessStatChannel;
|
||||||
|
|
||||||
|
@NacosValue(value = "${stat.topic:}", autoRefreshed = true)
|
||||||
@Value("${stat.topic:}")
|
@Value("${stat.topic:}")
|
||||||
private String fizzAccessStatTopic;
|
private String fizzAccessStatTopic;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package we.proxy;
|
||||||
|
|
||||||
|
import we.util.Constants;
|
||||||
|
import we.util.ThreadContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract implementation of {@code DiscoveryClientUriSelector}
|
||||||
|
*
|
||||||
|
* @author zhongjie
|
||||||
|
*/
|
||||||
|
abstract public class AbstractDiscoveryClientUriSelector implements DiscoveryClientUriSelector {
|
||||||
|
|
||||||
|
protected String buildUri(String ipAddr, int port, String path) {
|
||||||
|
StringBuilder b = ThreadContext.getStringBuilder();
|
||||||
|
return b.append(Constants.Symbol.HTTP_PROTOCOL_PREFIX).append(ipAddr).append(Constants.Symbol.COLON).append(port).append(path).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/main/java/we/proxy/DisableDiscoveryUriSelector.java
Normal file
19
src/main/java/we/proxy/DisableDiscoveryUriSelector.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package we.proxy;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The disable implementation of {@code DiscoveryClientUriSelector}, used when Nacos and Eureka discovery are not enabled.
|
||||||
|
*
|
||||||
|
* @author zhongjie
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ConditionalOnExpression("${nacos.discovery.enabled} == false and ${eureka.client.enabled} == false")
|
||||||
|
@Service
|
||||||
|
public class DisableDiscoveryUriSelector implements DiscoveryClientUriSelector {
|
||||||
|
@Override
|
||||||
|
public String getNextUri(String service, String relativeUri) {
|
||||||
|
throw new RuntimeException("No " + service + " because discovery disabled", null, false, false) {};
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/main/java/we/proxy/DiscoveryClientUriSelector.java
Normal file
16
src/main/java/we/proxy/DiscoveryClientUriSelector.java
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package we.proxy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@code DiscoveryClientUriSelector} is used to select the uri for the next request
|
||||||
|
*
|
||||||
|
* @author zhongjie
|
||||||
|
*/
|
||||||
|
public interface DiscoveryClientUriSelector {
|
||||||
|
/**
|
||||||
|
* find a instance of service by discovery and return the uri that http://{instance-ip-addr}:{instance-port}{relativeUri}
|
||||||
|
* @param service service name
|
||||||
|
* @param relativeUri relative uri
|
||||||
|
* @return the uri for the next request
|
||||||
|
*/
|
||||||
|
String getNextUri(String service, String relativeUri);
|
||||||
|
}
|
||||||
55
src/main/java/we/proxy/EurekaUriSelector.java
Normal file
55
src/main/java/we/proxy/EurekaUriSelector.java
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
package we.proxy;
|
||||||
|
|
||||||
|
import com.netflix.appinfo.InstanceInfo;
|
||||||
|
import com.netflix.discovery.EurekaClient;
|
||||||
|
import com.netflix.discovery.shared.Applications;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Eureka implementation of {@code DiscoveryClientUriSelector}
|
||||||
|
*
|
||||||
|
* @author zhongjie
|
||||||
|
*/
|
||||||
|
@ConditionalOnProperty(value = "eureka.client.enabled", matchIfMissing = true)
|
||||||
|
@Service
|
||||||
|
public class EurekaUriSelector extends AbstractDiscoveryClientUriSelector {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EurekaClient eurekaClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getNextUri(String service, String relativeUri) {
|
||||||
|
InstanceInfo inst = roundRobinChoose1instFrom(service);
|
||||||
|
return buildUri(inst.getIPAddr(), inst.getPort(), relativeUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// private static List<InstanceInfo> aggrMemberInsts = new ArrayList<>();
|
||||||
|
// static {
|
||||||
|
// InstanceInfo i0 = InstanceInfo.Builder.newBuilder().setAppName("TRIP-MINI").setIPAddr("xxx.25.63.192").setPort(7094).build();
|
||||||
|
// aggrMemberInsts.add(i0);
|
||||||
|
// }
|
||||||
|
// private static AtomicLong counter = new AtomicLong(0);
|
||||||
|
// private static final String aggrMember = "trip-mini";
|
||||||
|
|
||||||
|
|
||||||
|
private InstanceInfo roundRobinChoose1instFrom(String service) {
|
||||||
|
|
||||||
|
// if (aggrMember.equals(service)) {
|
||||||
|
// int idx = (int) (counter.incrementAndGet() % aggrMemberInsts.size());
|
||||||
|
// return aggrMemberInsts.get(idx);
|
||||||
|
// }
|
||||||
|
|
||||||
|
List<InstanceInfo> insts = eurekaClient.getInstancesByVipAddress(service, false);
|
||||||
|
if (insts == null || insts.isEmpty()) {
|
||||||
|
throw new RuntimeException("eureka no " + service, null, false, false) {};
|
||||||
|
}
|
||||||
|
Applications apps = eurekaClient.getApplications();
|
||||||
|
int index = (int) (apps.getNextIndex(service.toUpperCase(), false).incrementAndGet() % insts.size());
|
||||||
|
return insts.get(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,10 +17,7 @@
|
|||||||
|
|
||||||
package we.proxy;
|
package we.proxy;
|
||||||
|
|
||||||
import com.netflix.appinfo.InstanceInfo;
|
import com.alibaba.nacos.api.config.annotation.NacosValue;
|
||||||
import com.netflix.discovery.EurekaClient;
|
|
||||||
import com.netflix.discovery.shared.Applications;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -43,10 +40,7 @@ import we.util.WebUtils;
|
|||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongqiaowei
|
* @author hongqiaowei
|
||||||
@@ -62,7 +56,7 @@ public class FizzWebClient {
|
|||||||
private static final String localhost = "localhost";
|
private static final String localhost = "localhost";
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private EurekaClient eurekaClient;
|
private DiscoveryClientUriSelector discoveryClientUriSelector;
|
||||||
|
|
||||||
@Resource(name = ProxyWebClientConfig.proxyWebClient)
|
@Resource(name = ProxyWebClientConfig.proxyWebClient)
|
||||||
private WebClient proxyWebClient;
|
private WebClient proxyWebClient;
|
||||||
@@ -70,6 +64,7 @@ public class FizzWebClient {
|
|||||||
@Resource(name = AggrWebClientConfig.aggrWebClient)
|
@Resource(name = AggrWebClientConfig.aggrWebClient)
|
||||||
private WebClient aggrWebClient;
|
private WebClient aggrWebClient;
|
||||||
|
|
||||||
|
@NacosValue(value = "${fizz-web-client.timeout:-1}")
|
||||||
@Value("${fizz-web-client.timeout:-1}")
|
@Value("${fizz-web-client.timeout:-1}")
|
||||||
private long timeout = -1;
|
private long timeout = -1;
|
||||||
|
|
||||||
@@ -140,8 +135,7 @@ public class FizzWebClient {
|
|||||||
// what about multiple nginx instance
|
// what about multiple nginx instance
|
||||||
|
|
||||||
// current
|
// current
|
||||||
InstanceInfo inst = roundRobinChoose1instFrom(service);
|
String uri = discoveryClientUriSelector.getNextUri(service, relativeUri);
|
||||||
String uri = buildUri(inst, relativeUri);
|
|
||||||
return send2uri(originReqIdOrBizId, method, uri, headers, body, cbc);
|
return send2uri(originReqIdOrBizId, method, uri, headers, body, cbc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,37 +219,8 @@ public class FizzWebClient {
|
|||||||
// TODO 请求完成后,做metric, 以反哺后续的请求转发
|
// TODO 请求完成后,做metric, 以反哺后续的请求转发
|
||||||
}
|
}
|
||||||
|
|
||||||
private String buildUri(InstanceInfo inst, String path) {
|
|
||||||
StringBuilder b = ThreadContext.getStringBuilder();
|
|
||||||
return b.append(Constants.Symbol.HTTP_PROTOCOL_PREFIX).append(inst.getIPAddr()).append(Constants.Symbol.COLON).append(inst.getPort()).append(path).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// private static List<InstanceInfo> aggrMemberInsts = new ArrayList<>();
|
|
||||||
// static {
|
|
||||||
// InstanceInfo i0 = InstanceInfo.Builder.newBuilder().setAppName("TRIP-MINI").setIPAddr("xxx.25.63.192").setPort(7094).build();
|
|
||||||
// aggrMemberInsts.add(i0);
|
|
||||||
// }
|
|
||||||
// private static AtomicLong counter = new AtomicLong(0);
|
|
||||||
// private static final String aggrMember = "trip-mini";
|
|
||||||
|
|
||||||
|
|
||||||
private InstanceInfo roundRobinChoose1instFrom(String service) {
|
|
||||||
|
|
||||||
// if (aggrMember.equals(service)) {
|
|
||||||
// int idx = (int) (counter.incrementAndGet() % aggrMemberInsts.size());
|
|
||||||
// return aggrMemberInsts.get(idx);
|
|
||||||
// }
|
|
||||||
|
|
||||||
List<InstanceInfo> insts = eurekaClient.getInstancesByVipAddress(service, false);
|
|
||||||
if (insts == null || insts.isEmpty()) {
|
|
||||||
throw new RuntimeException("eureka no " + service, null, false, false) {};
|
|
||||||
}
|
|
||||||
Applications apps = eurekaClient.getApplications();
|
|
||||||
int index = (int) (apps.getNextIndex(service.toUpperCase(), false).incrementAndGet() % insts.size());
|
|
||||||
return insts.get(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String extractServiceOrAddress(String uriOrSvc) {
|
private String extractServiceOrAddress(String uriOrSvc) {
|
||||||
return uriOrSvc.substring(7, uriOrSvc.indexOf(Constants.Symbol.FORWARD_SLASH, 10));
|
return uriOrSvc.substring(7, uriOrSvc.indexOf(Constants.Symbol.FORWARD_SLASH, 10));
|
||||||
}
|
}
|
||||||
|
|||||||
86
src/main/java/we/proxy/NacosUriSelector.java
Normal file
86
src/main/java/we/proxy/NacosUriSelector.java
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
package we.proxy;
|
||||||
|
|
||||||
|
import com.alibaba.boot.nacos.discovery.properties.NacosDiscoveryProperties;
|
||||||
|
import com.alibaba.boot.nacos.discovery.properties.Register;
|
||||||
|
import com.alibaba.nacos.api.annotation.NacosInjected;
|
||||||
|
import com.alibaba.nacos.api.exception.NacosException;
|
||||||
|
import com.alibaba.nacos.api.naming.NamingService;
|
||||||
|
import com.alibaba.nacos.api.naming.pojo.Instance;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Nacos implementation of {@code DiscoveryClientUriSelector}
|
||||||
|
*
|
||||||
|
* @author zhongjie
|
||||||
|
*/
|
||||||
|
@ConditionalOnProperty(value = "nacos.discovery.enabled")
|
||||||
|
@Service
|
||||||
|
public class NacosUriSelector extends AbstractDiscoveryClientUriSelector {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(NacosUriSelector.class);
|
||||||
|
|
||||||
|
public NacosUriSelector(NacosDiscoveryProperties discoveryProperties) {
|
||||||
|
this.discoveryProperties = discoveryProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NacosInjected
|
||||||
|
private NamingService naming;
|
||||||
|
private NacosDiscoveryProperties discoveryProperties;
|
||||||
|
private String groupName;
|
||||||
|
private List<String> clusterNameList;
|
||||||
|
private boolean useGroupName;
|
||||||
|
private boolean userClusterName;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
Register register = discoveryProperties.getRegister();
|
||||||
|
if (register != null) {
|
||||||
|
this.groupName = register.getGroupName();
|
||||||
|
if (StringUtils.hasText(groupName)) {
|
||||||
|
this.useGroupName = true;
|
||||||
|
}
|
||||||
|
String clusterName = register.getClusterName();
|
||||||
|
if (StringUtils.hasText(clusterName)) {
|
||||||
|
this.userClusterName = true;
|
||||||
|
this.clusterNameList = Collections.singletonList(clusterName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getNextUri(String service, String relativeUri) {
|
||||||
|
Instance instance = this.selectOneHealthyInstance(service);
|
||||||
|
return super.buildUri(instance.getIp(), instance.getPort(), relativeUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Instance selectOneHealthyInstance(String service) {
|
||||||
|
Instance instance = null;
|
||||||
|
try {
|
||||||
|
if (useGroupName && userClusterName) {
|
||||||
|
instance = naming.selectOneHealthyInstance(service, groupName, clusterNameList);
|
||||||
|
} else if (useGroupName) {
|
||||||
|
instance = naming.selectOneHealthyInstance(service, groupName);
|
||||||
|
} else if (userClusterName) {
|
||||||
|
instance = naming.selectOneHealthyInstance(service, clusterNameList);
|
||||||
|
} else {
|
||||||
|
instance = naming.selectOneHealthyInstance(service);
|
||||||
|
}
|
||||||
|
} catch (NacosException e) {
|
||||||
|
log.warn("Nacos selectOneHealthyInstance({}) exception", service, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (instance == null) {
|
||||||
|
throw new RuntimeException("Nacos no " + service, null, false, false) {};
|
||||||
|
}
|
||||||
|
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,27 +1,82 @@
|
|||||||
#apollo:
|
# if you do not use Apollo, ignore the follow config
|
||||||
# bootstrap:
|
######################### Apollo config start #####################################
|
||||||
# enabled: true
|
apollo:
|
||||||
# namespaces: application
|
# if use Apollo set this flag to true
|
||||||
# eagerLoad:
|
enabled: false
|
||||||
# enabled: true
|
bootstrap:
|
||||||
|
# if use Apollo set this flag to true
|
||||||
|
enabled: false
|
||||||
|
namespaces: application
|
||||||
|
eagerLoad:
|
||||||
|
# if use Apollo set this flag to true
|
||||||
|
enabled: false
|
||||||
|
######################### Apollo config end #######################################
|
||||||
|
|
||||||
spring.profiles.active: dev
|
# if you do not use Nacos, ignore the follow config
|
||||||
|
######################### Nacos config start ######################################
|
||||||
|
nacos:
|
||||||
|
config:
|
||||||
|
# if use Nacos config set this flag to true
|
||||||
|
enabled: false
|
||||||
|
# need replace
|
||||||
|
server-addr: localhost:8848
|
||||||
|
auto-refresh: true
|
||||||
|
group: fizz-gateway
|
||||||
|
data-id: application
|
||||||
|
type: PROPERTIES
|
||||||
|
# need replace
|
||||||
|
namespace: c37ecd3b-e8b3-42cc-ba94-98e931e33683
|
||||||
|
discovery:
|
||||||
|
# if use Nacos discovery set this flag to true
|
||||||
|
enabled: false
|
||||||
|
# need replace
|
||||||
|
server-addr: localhost:8848
|
||||||
|
auto-register: true
|
||||||
|
register:
|
||||||
|
group-name: fizz-gateway
|
||||||
|
######################### Nacos config end #######################################
|
||||||
|
|
||||||
server.port: 8600
|
# if you do not use Eureka, ignore the follow config
|
||||||
|
######################### Eureka config start ####################################
|
||||||
|
eureka:
|
||||||
|
client:
|
||||||
|
# if use Eureka set this flag to true
|
||||||
|
enabled: false
|
||||||
|
serviceUrl:
|
||||||
|
# need replace
|
||||||
|
defaultZone: http://localhost:6600/eureka/
|
||||||
|
instance:
|
||||||
|
prefer-ip-address: true
|
||||||
|
######################### Eureka config end ######################################
|
||||||
|
|
||||||
eureka.instance.prefer-ip-address: true
|
server:
|
||||||
eureka.client.serviceUrl.defaultZone: http://localhost:6600/eureka/
|
port: 8600
|
||||||
spring.application.name: fizz-gateway
|
spring:
|
||||||
spring.cloud.loadbalancer.ribbon.enabled: false
|
profiles:
|
||||||
|
active: dev
|
||||||
|
application:
|
||||||
|
name: fizz-gateway
|
||||||
|
cloud:
|
||||||
|
loadbalancer:
|
||||||
|
ribbon:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
aggregate.redis.host: localhost
|
aggregate:
|
||||||
aggregate.redis.port: 6379
|
redis:
|
||||||
aggregate.redis.password: 123456
|
# need replace
|
||||||
aggregate.redis.database: 10
|
host: localhost
|
||||||
|
# need replace
|
||||||
|
port: 6379
|
||||||
|
# need replace
|
||||||
|
password: 123456
|
||||||
|
# need replace
|
||||||
|
database: 9
|
||||||
|
proxy-webclient:
|
||||||
|
name: proxy
|
||||||
|
aggr-webclient:
|
||||||
|
name: aggr
|
||||||
|
fizz-web-client:
|
||||||
|
timeout: 20000
|
||||||
|
log:
|
||||||
|
headers: COOKIE,FIZZ-APPID,FIZZ-SECRETKEY,FIZZ-SIGN,FIZZ-TS,FIZZ-RSV
|
||||||
|
|
||||||
proxy-webclient.name: proxy
|
|
||||||
aggr-webclient.name: aggr
|
|
||||||
|
|
||||||
fizz-web-client.timeout: 20000
|
|
||||||
|
|
||||||
log.headers: COOKIE,FIZZ-APPID,FIZZ-SECRETKEY,FIZZ-SIGN,FIZZ-TS,FIZZ-RSV
|
|
||||||
|
|||||||
Reference in New Issue
Block a user