天天看點

Hystrix Dashboard (斷路器:Hystrix 儀表盤)pom.xml添加依賴啟動類添加@EnableHystrixDashboard注解 浏覽器通路

目錄

pom.xml添加依賴

啟動類添加@EnableHystrixDashboard注解

 浏覽器通路

pom.xml添加依賴

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
           

啟動類添加@EnableHystrixDashboard注解

在主程式啟動類中加入@EnableHystrixDashboard注解,開啟hystrixDashboard:

@SpringBootApplication
@EnableDiscoveryClient
@EnableHystrix
@EnableHystrixDashboard
public class ServiceRibbonApplication {
..//代碼省略

}
           

 浏覽器通路

打開浏覽器:通路http://server:port/hystrix,界面如下

Hystrix Dashboard (斷路器:Hystrix 儀表盤)pom.xml添加依賴啟動類添加@EnableHystrixDashboard注解 浏覽器通路

輸入以下紅色區域内容:

Hystrix Dashboard (斷路器:Hystrix 儀表盤)pom.xml添加依賴啟動類添加@EnableHystrixDashboard注解 浏覽器通路

點選monitor stream,進入下一個界面,通路:http://localhost:8764/hi?name=forezp

此時會出現監控界面:

Hystrix Dashboard (斷路器:Hystrix 儀表盤)pom.xml添加依賴啟動類添加@EnableHystrixDashboard注解 浏覽器通路

繼續閱讀