turbine主要用于聚合hystrix的监控数据
依赖pom
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix</artifactId>
<version>1.0.7RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine</artifactId>
</dependency>
<dependencies>
入口程序
主要是@EnableTurbine
@SpringBootApplication
@EnableTurbine
@EnableDiscoveryClient
@EnableEurekaClient
public class Application extends SpringBootServletInitializer{
public static void main(String[] args){
SpringApplication.run(Application.class,args);
}
}
配置
turbine:
aggregator:
clusterConfig: FOO-SERVICE,BAR-SERVICE
appConfig: foo-service,bar-service
clusterNameExpression: 'default'