Sentinel icon indicating copy to clipboard operation
Sentinel copied to clipboard

springboot2.7.5版本@SentinelRestTemplate不生效

Open XW512 opened this issue 3 years ago • 9 comments

我的版本如下: <spring-boot.version>2.7.5</spring-boot.version> <alibaba-cloud.version>2021.0.4.0</alibaba-cloud.version> <springcloud.version>2021.0.4</springcloud.version>

发现@SentinelRestTemplate放在restTemplate中不生效,feign之间的调用倒是没什么问题,求解答,我猜测是版本不兼容, 能否给一个兼容版本,我使用了官网推荐的 springboot版本是2.6.11,也是不生效

XW512 avatar Nov 07 '22 12:11 XW512

For Spring Cloud Alibaba Sentinel, you may submit an issue in https://github.com/alibaba/spring-cloud-alibaba/issues

sczyh30 avatar Nov 08 '22 01:11 sczyh30

For Spring Cloud Alibaba Sentinel, you may submit an issue in https://github.com/alibaba/spring-cloud-alibaba/issues

OK,I'll ask the issue to go there

XW512 avatar Nov 08 '22 01:11 XW512

Keep track on https://github.com/alibaba/spring-cloud-alibaba/issues/2894

sczyh30 avatar Nov 19 '22 14:11 sczyh30

I found this might be a sentinel problem. My test codes as below:

@GetMapping("/rt")
public String rt() {
      return restTemplate.getForObject("https://httpbin.org/delay/1", String.class);
 }
# degrade rule
{
    "resource": "/rt",
    "count": 1,
    "grade": 0,
    "timeWindow": 30000
  }

In sentinel 1.7.1, request will be degraded. But in sentinel 1.8.1, rule won't be degraded.

steverao avatar Nov 25 '22 01:11 steverao

Hello, is there a version to solve this problem?

XW512 avatar Feb 01 '23 09:02 XW512

I tried to introduce Sentinel-core instead of spring-cloud-alibaba, and found that the 1.8.6 slow call ratio of Sentinel-core is not effective. If this version is changed to 1.6.4, it can be effective. Is there anything done by Sentinel that causes the fuse to fail to take effect? Is there any concern about this problem

XW512 avatar Feb 22 '23 06:02 XW512

I tried the 1.7.2 version of Sentinel-core. The fuse can take effect. The upgrade to 1.8.0 does not take effect. It should not take effect after 1.8.0

XW512 avatar Feb 22 '23 08:02 XW512

@sczyh30 Hello, can you help me look at this first?

XW512 avatar Mar 02 '23 01:03 XW512

I found this might be a sentinel problem. My test codes as below:

@GetMapping("/rt")
public String rt() {
      return restTemplate.getForObject("https://httpbin.org/delay/1", String.class);
 }
# degrade rule
{
    "resource": "/rt",
    "count": 1,
    "grade": 0,
    "timeWindow": 30000
  }

In sentinel 1.7.1, request will be degraded. But in sentinel 1.8.1, rule won't be degraded.

This code doesn't seem to have anything to do with @SentinelRestTemplate.

dowenliu-xyz avatar Jul 16 '24 12:07 dowenliu-xyz