spring cloud gateway 整合 sentinel 限流不生效
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Issue Description
## version
spring cloud gateway 2.2.5.RELEASE
cloud Hoxton.SR8
spring boot 2.3.12
## dependencies
```xml
com.alibaba.cloud
spring-cloud-starter-alibaba-sentinel
provided
com.alibaba.csp
sentinel-core
1.8.0
com.alibaba.csp
sentinel-core
${sentinel.version}
com.alibaba.csp
sentinel-transport-simple-http
${sentinel.version}
com.alibaba.csp
sentinel-datasource-extension
${sentinel.version}
com.alibaba.csp
sentinel-datasource-nacos
${sentinel.version}
com.alibaba.csp
sentinel-parameter-flow-control
${sentinel.version}
com.alibaba.csp
sentinel-transport-common
${sentinel.version}
com.alibaba.csp
sentinel-spring-cloud-gateway-adapter
${sentinel.version}
com.alibaba.csp
sentinel-spring-webflux-adapter
${sentinel.version}
```
### Describe what happened (or what feature you want)
1、我在dashboard上保存流控规则后持久化后至nacos

2、gateway 监听nacos规则发生变化后
GatewayRuleManager.loadRules 去加载了规则,但是访问资源时规制并没有生效
```java
case GATEWAY_API:
GatewayApiDefinitionManager.loadApiDefinitions(sentinelGatewayApiParser.convert(sentinelStrategyRule));
break;
case GATEWAY_FLOW:
GatewayRuleManager.loadRules(sentinelGatewayFlowRuleParser.convert(sentinelStrategyRule));
break;
```
### 结果限流并不生效,请问如何解决
### SentinelGatewayFilter routeId 会自动加上前缀,访问API时直接报404


Contributor guide
Research direction
Start by reproducing the reported behavior with Spring Cloud Gateway 2.2.5.RELEASE, Spring Boot 2.3.12, and the listed Sentinel dependencies. Read the GatewayRuleManager.loadRules path and SentinelGatewayFilter behavior, especially the routeId handling. Done means persisted rules take effect for gateway requests and valid API routes do not return 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100