sentinel--基础--03--整合springboot
先要请求这个接口,才能在sentinel控制台上看到数据。
·
sentinel–基础–03–整合springboot
代码位置
https://gitee.com/DanShenGuiZu/learnDemo/tree/master/sentinel_learn/demo2
1、引入依赖
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<version>2023.0.1.0</version>
</dependency>
2、添加配置
spring:
cloud:
sentinel:
transport:
dashboard: 127.0.0.1:8080 #控制台地址
3、测试
3.1、测试代码
@RestController
public class HelloController {
protected Logger logger = LoggerFactory.getLogger(getClass());
@RequestMapping("/getId/{id}")
public Integer getId(@PathVariable("id") Integer id) {
return id;
}
}
先要请求这个接口,才能在sentinel控制台上看到数据
http://127.0.0.1:5569/getId/5
3.2、控制台

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)