Issue Description
version
spring cloud gateway 2.2.5.RELEASE
cloud Hoxton.SR8
spring boot 2.3.12
dependencies
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-core</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-core</artifactId>
<version>${sentinel.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-transport-simple-http</artifactId>
<version>${sentinel.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-datasource-extension</artifactId>
<version>${sentinel.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-datasource-nacos</artifactId>
<version>${sentinel.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-parameter-flow-control</artifactId>
<version>${sentinel.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-transport-common</artifactId>
<version>${sentinel.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-spring-cloud-gateway-adapter</artifactId>
<version>${sentinel.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-spring-webflux-adapter</artifactId>
<version>${sentinel.version}</version>
</dependency>
Describe what happened (or what feature you want)
1、我在dashboard上保存流控规则后持久化后至nacos
2、gateway 监听nacos规则发生变化后
GatewayRuleManager.loadRules 去加载了规则,但是访问资源时规制并没有生效
case GATEWAY_API:
GatewayApiDefinitionManager.loadApiDefinitions(sentinelGatewayApiParser.convert(sentinelStrategyRule));
break;
case GATEWAY_FLOW:
GatewayRuleManager.loadRules(sentinelGatewayFlowRuleParser.convert(sentinelStrategyRule));
break;
9条答案
按热度按时间xmd2e60i1#
API gateway 默认统计维度都是 route 维度,可以按照簇点链路页面里面的 route 名称来配置,或自定义 API 分组来自定义统计维度。
ajsxfq5m2#
哥们我就是这样配置的。但是实际是不生效的哈
GatewayFlowSlot ->checkGatewayParamFlow -> GatewayRuleManager.getConvertedParamRules
SentinelGatewayFilter -> 结果 routeId 变了。。。然后再到 getRulesForResource 时就直接拿不到配置了。。。
ev7lccsx3#
你这个配置明显不是 route 的配置。根据簇点链路页面显示的资源名来配置,或自定义 API 分组。
ulydmbyx4#
哥们我是 gateway哈。
4bbkushb5#
URL 资源名不应该出现在这里。确保下 SCA 版本用的最新版本,并且 application.properties 里面
spring.cloud.sentinel.filter.enabled
配置项置为 falsey53ybaqx6#
谢谢,普通流控通了。但是热点不能生效哦
请求路径 http://192.168.1.206:8912/cid-cnn-runtime-management/api/open/ssh/tank?test=ppp
j9per5c47#
sentinel-parameter-flow-control也已经添加了的
8ulbf1ek8#
SentinelGatewayFilter 里对api分组的
ttygqcqt9#
我服了。。。原来是因为匹配串没有把应用名给带上所以一直匹配不上。大佬们这文档能不能说明一下哈。