目录
引入pom
这是官方指定的方式,springboot需要引入
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
除了这个还需要引入core包和sentinel客户端与dashboard通信包,不引入无法注册到dashboard上
<!--阿里的限流工具 sentinel-->
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-core</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-annotation-aspectj</artifactId>
<version>1.8.0</version>
</dependency>
<!-- sentinel客户端与dashboard通信依赖 -->
<depend

文章介绍了如何在SpringBoot项目中引入和配置Alibaba的Sentinel,包括在pom.xml中添加相关依赖以避免循环依赖问题,以及设置JVM启动参数以使服务成功注册到SentinelDashboard。同时,文章提到了一个ClassNotFoundException的问题及解决方案,即更新Sentinel版本至1.8.0。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



