git add .

This commit is contained in:
罗祥
2019-01-16 14:24:37 +08:00
parent 7c3e42909c
commit c19c349fd5
19 changed files with 206 additions and 38 deletions

View File

@ -1,14 +1,11 @@
package com.heibaiying.turbine;
import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.turbine.EnableTurbine;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
@EnableDiscoveryClient
@ -17,17 +14,6 @@ import org.springframework.context.annotation.Bean;
@EnableTurbine
public class TurbineApplication {
@Bean
public ServletRegistrationBean getServlet() {
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings("/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}
public static void main(String[] args) {
SpringApplication.run(TurbineApplication.class, args);
}

View File

@ -1,5 +1,5 @@
server:
port: 8090
port: 8040
# 指定服务命名
spring:
application:
@ -13,9 +13,9 @@ eureka:
turbine:
aggregator:
cluster-config: default
app-config: consumer
clusterNameExpression: new String("default")
instanceUrlSuffix:
default: actuator/hystrix.stream
combine-host-port: true
app-config: consumer,producer
clusterNameExpression: "'default'"