第十四章:Sentinel服务
一、引入服务
1)、去官网下载jar包
2)、在common中引入spring-cloud-starter-alibaba-sentinel
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
3)、配置控制台
#sentinel控制台
spring.cloud.sentinel.transport.port=8719
spring.cloud.sentinel.transport.dashboard=localhost:8080
#暴露审计信息
management.endpoints.web.exposure.include=*
4)、配置自定义流控
@Configuration
public class SeckillSentinelConfig implements BlockExceptionHandler {
@Override
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, BlockException e) throw