alibaba / alibaba/Sentinel

Sentinel结合Gateway是否可以在网关层实现熔断

Open
#2,863 4 comments 0 reactions 0 assignees View on GitHub
area/circuit-breaking area/gateway-flow-control kind/question
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Sentinel结合Gateway是否可以在网关层实现熔断?
我在sentinel加入了对geteway的支持配置,参考文档https://github.com/alibaba/spring-cloud-alibaba/wiki/Sentinel
Sentinel-dashboard页面中也确实出现了gateway的控制信息
![image](https://user-images.githubusercontent.com/43001304/187904344-53a92545-6375-4382-8b17-0433374a21e7.png)

上图中的流控现象我在控制台配置相关的流控规则之后确实可以进入自定义的错误信息配置即

spring:
sentinel:
scg:
fallback:
mode: response
response-body: '{"code":403,"mes":"调用路由异常"}'

但是我配置熔断规则之后,发现请求依旧会走入到相关的接口代码中,所以我想问一下这边Sentinel结合Gateway是不是只能在网关层实现流控功能而不能实现熔断功能呢?另外我在sentinel官网上看到Sentinel 支持对 Spring Cloud Gateway、Zuul 等主流的 API Gateway 进行限流,
![image](https://user-images.githubusercontent.com/43001304/187904962-fb058f5c-e970-4fa7-bb5e-f6332abb349b.png)

所以我想确认一下Sentinel结合Gateway是不是不可以在网关层实现熔断

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported behavior with the Sentinel dashboard and the Spring Cloud Gateway configuration shown in the issue. Compare the configured flow-control and circuit-breaking rules, then verify whether requests reach the route handler; done means the gateway behavior is confirmed and documented or a focused fix is identified.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.