diff --git a/yudao-framework/yudao-spring-boot-starter-protection/pom.xml b/yudao-framework/yudao-spring-boot-starter-protection/pom.xml index 46fd97e43..a93991ff5 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-protection/pom.xml @@ -35,12 +35,6 @@ lock4j-redisson-spring-boot-starter true - - - io.github.resilience4j - resilience4j-spring-boot2 - true - diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/resilience4j/package-info.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/resilience4j/package-info.java deleted file mode 100644 index 649e8a0ea..000000000 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/resilience4j/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 使用 Resilience4j 组件,实现服务保障,包括: - * 1. 熔断器 - * 2. 限流器 - * 3. 舱壁隔离 - * 4. 重试 - * 5. 限时器 - */ -package cn.iocoder.yudao.framework.resilience4j; diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/resilience4j/《芋道 Spring Boot 服务容错 Resilience4j 入门》.md b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/resilience4j/《芋道 Spring Boot 服务容错 Resilience4j 入门》.md deleted file mode 100644 index 8d6d0335b..000000000 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/resilience4j/《芋道 Spring Boot 服务容错 Resilience4j 入门》.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java index ec3dffda3..8ddddcee4 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java @@ -181,14 +181,6 @@ public class GlobalExceptionHandler { return CommonResult.error(METHOD_NOT_ALLOWED.getCode(), String.format("请求方法不正确:%s", ex.getMessage())); } - /** - * 处理 Resilience4j 限流抛出的异常 - */ - public CommonResult requestNotPermittedExceptionHandler(HttpServletRequest req, Throwable ex) { - log.warn("[requestNotPermittedExceptionHandler][url({}) 访问过于频繁]", req.getRequestURL(), ex); - return CommonResult.error(TOO_MANY_REQUESTS); - } - /** * 处理 Spring Security 权限不足的异常 * @@ -223,12 +215,7 @@ public class GlobalExceptionHandler { return tableNotExistsResult; } - // 情况二:部分特殊的库的处理 - if (Objects.equals("io.github.resilience4j.ratelimiter.RequestNotPermitted", ex.getClass().getName())) { - return requestNotPermittedExceptionHandler(req, ex); - } - - // 情况三:处理异常 + // 情况二:处理异常 log.error("[defaultExceptionHandler]", ex); // 插入异常日志 this.createExceptionLog(req, ex); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/application-unit-test.yaml b/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/application-unit-test.yaml index 1bbe0f530..dd9b95bfb 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/application-unit-test.yaml @@ -32,8 +32,6 @@ mybatis-plus: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-crm/yudao-module-crm-biz/src/test/resources/application-unit-test.yaml b/yudao-module-crm/yudao-module-crm-biz/src/test/resources/application-unit-test.yaml index 767f2526f..0fc9151be 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-crm/yudao-module-crm-biz/src/test/resources/application-unit-test.yaml @@ -38,8 +38,6 @@ mybatis-plus: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/application-unit-test.yaml b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/application-unit-test.yaml index 31e5ae5c9..3dfaddad6 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/application-unit-test.yaml @@ -38,8 +38,6 @@ mybatis-plus: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/resources/application-unit-test.yaml b/yudao-module-mall/yudao-module-product-biz/src/test/resources/application-unit-test.yaml index 31e5ae5c9..3dfaddad6 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-mall/yudao-module-product-biz/src/test/resources/application-unit-test.yaml @@ -38,8 +38,6 @@ mybatis-plus: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/test/resources/application-unit-test.yaml b/yudao-module-mall/yudao-module-promotion-biz/src/test/resources/application-unit-test.yaml index a384353aa..c656a9fe4 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-mall/yudao-module-promotion-biz/src/test/resources/application-unit-test.yaml @@ -37,8 +37,6 @@ mybatis: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-mall/yudao-module-trade-biz/src/test/resources/application-unit-test.yaml b/yudao-module-mall/yudao-module-trade-biz/src/test/resources/application-unit-test.yaml index b548da6a3..8ba2503d9 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-mall/yudao-module-trade-biz/src/test/resources/application-unit-test.yaml @@ -37,8 +37,6 @@ mybatis: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-member/yudao-module-member-biz/src/test/resources/application-unit-test.yaml b/yudao-module-member/yudao-module-member-biz/src/test/resources/application-unit-test.yaml index a384353aa..c656a9fe4 100644 --- a/yudao-module-member/yudao-module-member-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-member/yudao-module-member-biz/src/test/resources/application-unit-test.yaml @@ -37,8 +37,6 @@ mybatis: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test-integration/resources/application-integration-test.yaml b/yudao-module-pay/yudao-module-pay-biz/src/test-integration/resources/application-integration-test.yaml index c8e34e476..a4d43694d 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test-integration/resources/application-integration-test.yaml +++ b/yudao-module-pay/yudao-module-pay-biz/src/test-integration/resources/application-integration-test.yaml @@ -70,16 +70,6 @@ mybatis-plus: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 -resilience4j: - ratelimiter: - instances: - backendA: - limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50 - limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500 - timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s - register-health-indicator: true # 是否注册到健康监测 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/resources/application-unit-test.yaml b/yudao-module-pay/yudao-module-pay-biz/src/test/resources/application-unit-test.yaml index a384353aa..c656a9fe4 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/resources/application-unit-test.yaml @@ -37,8 +37,6 @@ mybatis: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-report/yudao-module-report-biz/src/test/resources/application-unit-test.yaml b/yudao-module-report/yudao-module-report-biz/src/test/resources/application-unit-test.yaml index 460d4a250..eb823d904 100644 --- a/yudao-module-report/yudao-module-report-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-report/yudao-module-report-biz/src/test/resources/application-unit-test.yaml @@ -38,8 +38,6 @@ mybatis: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-system/yudao-module-system-biz/src/test-integration/resources/application-integration-test.yaml b/yudao-module-system/yudao-module-system-biz/src/test-integration/resources/application-integration-test.yaml index d9612eee7..6b2fd822b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test-integration/resources/application-integration-test.yaml +++ b/yudao-module-system/yudao-module-system-biz/src/test-integration/resources/application-integration-test.yaml @@ -74,16 +74,6 @@ mybatis: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 -resilience4j: - ratelimiter: - instances: - backendA: - limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50 - limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500 - timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s - register-health-indicator: true # 是否注册到健康监测 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-module-system/yudao-module-system-biz/src/test/resources/application-unit-test.yaml b/yudao-module-system/yudao-module-system-biz/src/test/resources/application-unit-test.yaml index 460d4a250..eb823d904 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/resources/application-unit-test.yaml +++ b/yudao-module-system/yudao-module-system-biz/src/test/resources/application-unit-test.yaml @@ -38,8 +38,6 @@ mybatis: # Lock4j 配置项(单元测试,禁用 Lock4j) -# Resilience4j 配置项 - --- #################### 监控相关配置 #################### --- #################### 芋道相关配置 #################### diff --git a/yudao-server/src/main/resources/application-dev.yaml b/yudao-server/src/main/resources/application-dev.yaml index c64f3cc99..e5bc08bee 100644 --- a/yudao-server/src/main/resources/application-dev.yaml +++ b/yudao-server/src/main/resources/application-dev.yaml @@ -117,16 +117,6 @@ lock4j: acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒 expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒 -# Resilience4j 配置项 -resilience4j: - ratelimiter: - instances: - backendA: - limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50 - limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500 - timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s - register-health-indicator: true # 是否注册到健康监测 - --- #################### 监控相关配置 #################### # Actuator 监控端点的配置项 diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index a3df77684..d1826b770 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -135,16 +135,6 @@ lock4j: acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒 expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒 -# Resilience4j 配置项 -resilience4j: - ratelimiter: - instances: - backendA: - limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50 - limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500 - timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s - register-health-indicator: true # 是否注册到健康监测 - --- #################### 监控相关配置 #################### # Actuator 监控端点的配置项