git add .
This commit is contained in:
@ -15,7 +15,17 @@ import org.springframework.context.annotation.Bean;
|
||||
@EnableHystrixDashboard
|
||||
public class ConsumerApplication {
|
||||
|
||||
@Bean
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConsumerApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 这种方式对servlet进行注册和在配置文件中开启端点是等效的
|
||||
* 可以在启动的监控日志中看到端点的注册信息:
|
||||
* o.s.b.a.e.web.ServletEndpointRegistrar : Registered '/actuator/hystrix.stream' to hystrix.stream-actuator-endpoint
|
||||
|
||||
@Bean
|
||||
public ServletRegistrationBean getServlet() {
|
||||
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
|
||||
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
|
||||
@ -23,11 +33,7 @@ public class ConsumerApplication {
|
||||
registrationBean.addUrlMappings("/actuator/hystrix.stream");
|
||||
registrationBean.setName("HystrixMetricsStreamServlet");
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConsumerApplication.class, args);
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.heibaiying.consumer.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author : heibaiying
|
||||
*/
|
||||
@RestController
|
||||
public class CustomController {
|
||||
|
||||
@GetMapping("consumers")
|
||||
public String queryCustoms() {
|
||||
return "用户产品偏好列表生成中,请月底再获取";
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 8080
|
||||
port: 8030
|
||||
# 指定服务命名
|
||||
spring:
|
||||
application:
|
||||
@ -9,4 +9,10 @@ eureka:
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: http://localhost:8010/eureka/
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
# 需要开启hystrix.stream端点的暴露 这样才能获取到监控信息 * 代表开启可监控端点
|
||||
include: "*"
|
||||
|
||||
|
Reference in New Issue
Block a user