alibaba / alibaba/Sentinel

关于热点参数规则的两个问题

Open
#3,455 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

Sentinel 版本 1.8.6

问题一
直接在请求响应这一层的资源,例如
```
@GetMapping("/s3/g")
public String g(String hotParam, String value) {
return service.g(hotParam, value);
}
```
以请求路径为资源名,设置了热点参数规则
![热点规则](https://github.com/user-attachments/assets/45b3a544-17f4-47a3-b9a0-123c3af1aeeb)
但实际运行中,热点规则似乎不生效

另外,在请求响应上套一层@SentinelResource ,针对SentinelResource 指定的资源,设置热点参数规则是可以生效的
是热点参数规则不支持直接在请求响应上设置规则吗?还是我漏了什么设置?

问题二
我通过实现 BlockExceptionHandler 接口的组件,想在全局范围内实现 触发规则的BlockException处理
普通流控规则是可以捕获到BlockException(FlowException)做处理的
但是对于热点参数规则,捕获不到BlockException(ParamFlowException)而无法做处理(异常仍然被抛出,最终导致500错误)
对此 我需要怎样处理呢?

谢谢

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.