1、POM配置
和普通Spring Boot工程相比,仅仅添加了Hystrix Dashboard和Spring Boot Starter Actuator依赖
<dependencies>
<!--添加Turbine依赖-->
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Dalston.SR2</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
02、使能Eureka Server
@SpringBootApplication
@EnableHystrixDashboard//使能HystrixDashboard
public class Application {
public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
03、src/main/resources工程配置文件application.yml内容如下
spring:
application:
name: hystrix-dashboard
server:
port: 4010
04、使用方法
a)浏览器访问http://localhost:4010/hystrix.dashboard
b)Hystrix Dashboard下输入http://localhost:4001/turbine.stream,点击Monitor Stream即可看到监控面板