springboot2.7.5版本@SentinelRestTemplate不生效

cunj1qz1  于 4个月前  发布在  Spring
关注(0)|答案(9)|浏览(135)

我的版本如下:

<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,也是不生效

7uhlpewt

7uhlpewt1#

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

alen0pnh

alen0pnh2#

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

6rqinv9w

6rqinv9w4#

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.

67up9zun

67up9zun5#

Hello, is there a version to solve this problem?

6l7fqoea

6l7fqoea6#

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

vjrehmav

vjrehmav7#

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

0yycz8jy

0yycz8jy8#

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

v7pvogib

v7pvogib9#

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 .

相关问题