mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
4.4.0
This commit is contained in:
@@ -11,9 +11,7 @@ SOP提供了简单的接口限流策略:
|
||||
|
||||
默认情况下接口的限流功能是关闭的,可在sop admin中配置并开启。功能在`路由管理-->限流管理`下。
|
||||
|
||||
## 新版限流(1.9.0)
|
||||
|
||||
1.9.0将之前的限流进行了改造,新的限流支持更多的限流方式。之前只能针对某个接口限流,新版限流可以在`路由ID(接口)、appKey、ip`上进行限流。
|
||||
## 多维度限流
|
||||
|
||||
- 可针对接口进行限流,所有访问该接口的请求都被限流
|
||||
- 可针对appKey进行限流,某个appKey请求过来后,对他限流
|
||||
|
@@ -1,53 +1,3 @@
|
||||
# 使用eureka
|
||||
|
||||
## 修改网关
|
||||
|
||||
- 打开`/sop-gateway/pom.xml`
|
||||
|
||||
注释nacos相关依赖
|
||||
|
||||
添加eureka依赖:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
- 打开sop-gateway下`application-dev.properties`
|
||||
|
||||
注释nacos配置
|
||||
|
||||
```properties
|
||||
# nacos cloud配置
|
||||
#spring.cloud.nacos.discovery.server-addr=${register.url}
|
||||
#nacos.config.server-addr=${register.url}
|
||||
```
|
||||
|
||||
添加eureka配置
|
||||
|
||||
```properties
|
||||
# eureka注册中心
|
||||
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
|
||||
```
|
||||
|
||||
## 微服务端修改
|
||||
|
||||
步骤同上
|
||||
|
||||
## admin修改
|
||||
|
||||
打开`application-dev.properties`,新增配置
|
||||
|
||||
```properties
|
||||
# 网关地址,多个用逗号隔开
|
||||
# 在不使用nacos时有用,使用nacos时注释掉
|
||||
gateway.host=127.0.0.1:8081
|
||||
|
||||
# eureka注册中心
|
||||
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
|
||||
# 如果使用eureka,填eureka,使用nacos,填nacos
|
||||
registry.name=eureka
|
||||
```
|
||||
|
||||
切换到`eureka`分支
|
||||
|
BIN
doc/docs/files/images/10093_1.png
Normal file
BIN
doc/docs/files/images/10093_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 84 KiB |
BIN
doc/docs/files/images/10093_2.png
Normal file
BIN
doc/docs/files/images/10093_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
Reference in New Issue
Block a user