springcloud Finchley改动很大,很多配置的名称,模块的名称都变了,开启hystrix dashboard页也不一样
pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
bootstrap.properties 配置。开启暴露接口
#/actuator/hystrix.stream
management.endpoints.web.exposure.include=*
启动类main注解
@EnableCircuitBreaker
@EnableHystrixDashboard
访问ip:port/contextPath/hystrix
输入ip:port/contextPath/actuator/hystrix.stream 上下都显示loading 就说明连接上了
访问被@HystrixCommand注解的方法,就能看到统计