Spring Cloud Alibaba 之 “Sentinel”

从网上下载好sentinel-dashboard-1.6.3.jar,然后执行 java -jar sentinel-dashboard-1.6.3.jar,执行成功之后在浏览器输入localhost:8080,Sentinel的登录名和密码都是sentinel,登陆成功之后看到只有一个首页。

接下来开始整合Spring Cloud Alibaba + Sentinel,还是基于上篇文章的二个SpringBoot项目article-center,首先加依赖

复制代码
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
        </dependency>

然后写配置:(这里注意以下Sentinel默认使用8080端口,所以注意下端口冲突)

接下来启动article-center和people-center二个项目,启动之后访问 http://localhost:8083/feignTest

这个接口是上篇文章整合Feign写的接口,调用成功之后,回到Sentinel的ui页面,刷新,会看到如下:

接下来我们可以针对各个接口做【流控】【降级】等配置了,到此Spring Cloud Aliabab整合Sentinel就完成了,其它项目整合也按照这个流程

相关推荐
_一条咸鱼_20 分钟前
揭秘 Android TextInputLayout:从源码深度剖析其使用原理
android·java·面试
_一条咸鱼_20 分钟前
揭秘!Android VideoView 使用原理大起底
android·java·面试
_一条咸鱼_21 分钟前
深度揭秘!Android TextView 使用原理全解析
android·java·面试
_一条咸鱼_24 分钟前
深度剖析:Android Canvas 使用原理全揭秘
android·java·面试
_一条咸鱼_24 分钟前
深度剖析!Android TextureView 使用原理全揭秘
android·java·面试
_一条咸鱼_25 分钟前
揭秘!Android CheckBox 使用原理全解析
android·java·面试
_一条咸鱼_26 分钟前
深度揭秘:Android Toolbar 使用原理的源码级剖析
android·java·面试
_一条咸鱼_28 分钟前
揭秘 Java ArrayList:从源码深度剖析其使用原理
android·java·面试