Amateur Grass Springcloud Tutorial | 12th article: Circuit Breaker aggregation monitoring (Hystrix Turbine) (Finchley version)

Source: Internet
Author: User

The previous article described how to use Hystrix Dashboard to monitor the Hystrix command of a circuit breaker. When we have a lot of services, this needs to be aggregated so that the service Hystrix dashboard data. This requires another component of Spring cloud, the Hystrix Turbine.

I. Introduction of HYSTRIX turbine

Looking at the individual Hystrix dashboard data does not have much value, want to see this system Hystrix dashboard data need to use Hystrix Turbine. Hystrix Turbine integrates each service Hystrix dashboard data. The use of Hystrix turbine is very simple, just to introduce the appropriate dependencies and add annotations and configuration.

Ii. preparatory work

The project used in this paper is a project of the previous article, which is reformed on this basis. Because we need multiple services dashboard, so need to build a service, named Service-lucy, its basic configuration with Service-hi, the specific source, here is not detailed description.

Iii. creation of Service-turbine

The corresponding dependencies are introduced:

1<dependencies>2<dependency>3<groupId>org.springframework.cloud</groupId>4<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>5</dependency>6<dependency>7<groupId>org.springframework.boot</groupId>8<artifactId>spring-boot-starter-web</artifactId>9</dependency>Ten<dependency> One<groupId>org.springframework.boot</groupId> A<artifactId>spring-boot-starter-actuator</artifactId> -</dependency> -<dependency> the<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> A<dependency> at<groupId>org.springframework.cloud</groupId> -<artifactId>spring-cloud-starter-netflix-turbine</artifactId> -</dependency> -   -</dependencies>

In its entry class serviceturbineapplication add annotation @enableturbine, open turbine, @EnableTurbine annotations contain @enablediscoveryclient annotations, The registration service is turned on.

1  2 @SpringBootApplication3 @EnableEurekaClient4 @EnableDiscoveryClient5 @RestController6 @EnableHystrix7 @EnableHystrixDashboard8 @EnableCircuitBreaker9 @EnableTurbineTen  Public classserviceturbineapplication { One   A     /** -      * http://localhost: 8764/turbine.stream -      */ the   -      Public Static voidMain (string[] args) { -Springapplication.run (serviceturbineapplication.class, args); -     } +}

Configuration file Application.yml:

1 Server:2port:87643  4 Spring:5 Application:6name:service-Turbine7  8 Eureka:9 Client:Ten serviceurl: OneDefaultzone:http://localhost:8761/eureka/ A Management: - Endpoints: - Web: the Exposure: -Include: "*" - cors: -Allowed-origins: "*" +Allowed-methods: "*" -   + Turbine: Aapp-config:service-hi,service-Lucy at Aggregator: -Clusterconfig:default -Clusternameexpression:NewString ("Default") -Combine-host:true - Instanceurlsuffix: -     default: Actuator/hystrix.stream

The configuration file annotations are written clearly.

Iv. Turbine Demo

Turn on Eureka-server, Service-hi, Service-lucy, Service-turbine Engineering.

Open Browser Input: Http://localhost:8764/turbine.stream, the interface is as follows:

Request in turn:

Http://localhost:8762/hi?name=forezp

Http://localhost:8763/hi?name=forezp

Open: Http://localhost:8763/hystrix, input monitor stream http://localhost:8764/turbine.stream

Click on the monitor stream to enter the page:

You can see that this page aggregates the Hystrix dashbord data for 2 service.

SOURCE Download:
Https://github.com/forezp/SpringCloudLearning/tree/master/sc-f-chapter13

V. References

Hystrix_dashboard

Turbine

Thank you for your attention! Add QQ1 Group: 135430763,QQ2 Group: 454796847,QQ3 Group: 187424846. QQ Group into the group password: xttblog, want to add a group of friends, you can search: Xmtxtt, note: "Xttblog", add Assistant pull you into the group. Note errors do not agree with a friend application. Thanks again for your attention! Follow up with wonderful content will be sent to you the first time! Please send the original article to [email protected] email. Business cooperation can add assistants to communicate!

Amateur Grass Springcloud Tutorial | 12th article: Circuit Breaker aggregation monitoring (Hystrix Turbine) (Finchley version)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.