美文网首页
springboot-alibabacloud-sentinel

springboot-alibabacloud-sentinel

作者: 前进的码农 | 来源:发表于2020-11-30 10:24 被阅读0次

官方文档

sentinel介绍

https://github.com/alibaba/Sentinel/wiki/%E4%B8%BB%E9%A1%B5

sentinel和alibabacloud结合手册

https://github.com/alibaba/spring-cloud-alibaba/wiki/Sentinel

控制台安装

参考第一篇文章
https://www.jianshu.com/writer#/notebooks/48706360/notes/80553677

使用

引入pom

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>

在配置文件中配置交互配置

spring.cloud.sentinel.transport.port=8719
spring.cloud.sentinel.transport.dashboard=localhost:8080

随便写一个get接口然后访问

进入Sentinel控制台给刚刚的写的接口配置流控规则

image.png

为了方便测试我这里的设置qps为1

效果

把刚刚写的接口地址输入到浏览器刷新


image.png

不停的刷新就会看到流控的效果。

相关文章

网友评论

      本文标题:springboot-alibabacloud-sentinel

      本文链接:https://www.haomeiwen.com/subject/ddklwktx.html