pom配置html
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId> <version>1.3.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
application.ymljava
spring: application: name: hystrix-dashboard server: port: 8083
application啓動類spring
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; @EnableHystrixDashboard @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
啓動完成在瀏覽器輸入 http://localhost:8083/hystrix.stream進入Hystrix熔斷監控界面,如圖:瀏覽器