Я пытаюсь создать простое весеннее облачное приложение с использованием службы обнаружения Netflix eureka и автоматического выключателя Hystrix.
Обслуживание выключателя:
@EnableCircuitBreaker
@SpringBootApplication
@EnableEurekaClient
public class PluralsightEurekaFastpassConsoleApplication {
public static void main(String[] args) {
SpringApplication.run(PluralsightEurekaFastpassConsoleApplication.class, args);
}
}
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>
spring-cloud-starter-netflix-hystrix
</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Панель управления Hystrix
@EnableHystrixDashboard
@SpringBootApplication
@EnableDiscoveryClient
public class PluralsiteHystrixDashboardApplication {
public static void main(String[] args) {
SpringApplication.run(PluralsiteHystrixDashboardApplication.class, args);
}
}
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
панель приборов Hystrix
Журнал консоли
2018-07-04 20: 15: 25.051 INFO 17516 --- [nio-8088-exec-1]
ashboardConfiguration $ ProxyStreamServlet: открытие соединения с прокси
до: http://localhost:8088/actuator/hystrix.stream 2018-07-04
20: 15: 25.052 INFO 17516 --- [nio-8088-exec-6]
ashboardConfiguration $ ProxyStreamServlet: открытие соединения с прокси
до: http://localhost:8088/actuator/hystrix.stream 2018-07-04
20: 15: 25.058 WARN 17516 --- [nio-8088-exec-1]
ashboardConfiguration $ ProxyStreamServlet: Не удалось открыть соединение
до http://localhost:8088/actuator/hystrix.stream: 404: HTTP / 1,1 404
2018-07-04 20: 15: 25.058 WARN 17516 --- [nio-8088-exec-6]
ashboardConfiguration $ ProxyStreamServlet: Не удалось открыть соединение
до http://localhost:8088/actuator/hystrix.stream: 404: HTTP / 1.1 404
Я пытался Невозможно подключиться к Command Metric Stream для Hystrix Dashboard с Spring Cloud
но проблема все еще существует.