Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wrgljylys opened this issue Oct 17, 2024 · 1 comment
Open

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

wrgljylys opened this issue Oct 17, 2024 · 1 comment

Comments

@wrgljylys
Copy link

Sentinel 版本 1.8.6

问题一
直接在请求响应这一层的资源,例如

    @GetMapping("/s3/g")
    public String g(String hotParam, String value) {
        return service.g(hotParam, value);
    }

以请求路径为资源名,设置了热点参数规则
热点规则
但实际运行中,热点规则似乎不生效

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

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

谢谢

@XiaZhouxx
Copy link

看了下第一个问题应该就是bug [#3453], 第二问题应该就是实现不同, @SentinelResource 需要在注解指定异常处理类, 它的实现没有基于BlockExceptionHandler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants