Building a Hystrix Dashboard in Spring Cloud is as simple as following four steps:

Create a standard Spring Boot project named hystrix-Dashboard. Edit pom.xml with the following dependencies:


org.springframework.cloud

spring-cloud-starter-parent

Dalston.SR1



org.springframework.cloud spring-cloud-starter-hystrix org.springframework.cloud spring-cloud-starter-hystrix-dashboard Org.springframework. Boot Spring-boot-starter -actuator adds @enableHystrixDashboard to the main application class to enable the HystrixDashboard. @EnableHystrixDashboard @SpringCloudApplication public class HystrixDashboardApplication { public static void main(String[] args) { SpringApplication.run(HystrixDashboardApplication.class, args); }} Modify the application.properties configuration file as required, for example, select an unused port. This step is optional. Spring.application. name= hystrix-Dashboard server.port=1301 Since hystrix dashboard monitors a single instance node by accessing the /hystrix.stream interface of the instance, Naturally, we need to add this endpoint for the service instance, and the steps to add this functionality are equally simple:

Add the Spring-boot-starter -actuator monitoring module in the Dependencies node in pm. XML to enable monitoring endpoints and ensure that the dependencies of spring-cloud-starter-hystrix are added:


org.springframework.cloud

spring-cloud-starter-hystrix

Org.springframework. boot Spring-boot-starter -actuator ensures that the breaker function is enabled using @enablecircuitbreaker or @enablehystrix in the main class of the service instance. Now that all the configuration is complete, you have started monitoring “Eureka – Consumer -ribbon- Hystrix”, click the “Monitor Stream” button.

From now on, I will record the construction process and essence of springCloud micro-service cloud architecture recently developed, to help more friends who are interested in developing Spring Cloud framework, and I hope to help more good scholars. Discuss the process of building the Spring Cloud architecture and how it can be applied to enterprise projects. Source: source minglisoft. Cn/honghu/tech…