Header GatewayFlowRule rule-type=flow does not take effect | SCA GatewayFlowRule配置header参数限流不生效
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Issue Description
网关规则参数:
{
"burst": 0,
"controlBehavior": 2,
"count": 1.0,
"grade": 1,
"intervalSec": 1,
"maxQueueingTimeoutMs": 600,
"paramItem": {
"fieldName": "clientId",
"matchStrategy": 0,
"parseStrategy": 2,
"pattern": "test"
},
"resource": "/list",
"resourceMode": 0
}
sentinel配置
spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
cloud:
sentinel:
enabled: true
filter:
enabled: true
transport:
port: 8719
dashboard: localhost:8080
datasource:
ds:
nacos:
### nacos连接地址
server-addr: localhost:8848
## nacos连接的分组
group-id: DEFAULT_GROUP
###路由存储规则
rule-type: flow
### 读取配置文件的 data-id
data-id: member-sentinal
### 读取培训文件类型为json
data-type: json
### Describe what happened (or what feature you want)
1、请求网关接口/list,分别带header参数clientId和不带都不触发限流规则
2、尝试将resource配置为routeId,依然不起作用
3、官方单元测试以及wiki对该部分描述未详尽,demo起不到引导作用
### Describe what you expected to happen
1、期望能按照规则执行限流
### How to reproduce it (as minimally and precisely as possible)
1. nacos 2.0.2
2. sentinel 1.8.2
### Tell us your environment
local
### Anything else we need to know?
Contributor guide
Research direction
Start by reproducing the GatewayFlowRule configuration with Nacos 2.0.2, Sentinel 1.8.2, and the /list gateway request, both with and without the clientId header. Trace the Spring Cloud Sentinel gateway rule entry point to determine why rule-type=flow and routeId do not trigger. Done means the documented configuration reliably applies the expected rate limit, with tests or documentation covering the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100