流量控制sentinel与Hystrix
sentinel
地址:https://github.com/alibaba/Sentinel/wiki/介绍
sentinel使用教程
地址:https://github.com/alibaba/Sentinel/wiki/如何使用
sentinel主流框架的适配
地址:https://github.com/alibaba/Sentinel/wiki/主流框架的适配
Sentinel 与 Spring Boot/Spring Cloud 的整合见 Sentinel Spring Cloud Starter
使用Spring Boot/Spring Cloud与sentinel进行整合,地址:Sentinel Spring Cloud Starter
导入依赖
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
sentinel版本要与控制台版本一致
获取控制台
可以从 https://github.com/alibaba/Sentinel/releases 页面 下载最新版本的控制台 jar 包。
启动控制台
以 Spring Boot 的方式运行 jar 包即可
java -jar sentinel-dashboard.jar -Dserver.port=****
如若8080端口冲突,可使用 -Dserver.port=新端口 进行设置。
配置控制台信息
application.yml
spring:
cloud:
sentinel:
transport:
port: 8719
dashboard: localhost:****
实时监控显示Endpoint 支持
导入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.4.