2

我浏览了以下链接:Spring Boot + Eureka Server + Hystrix with Turbine: empty turbine.stream,但仍然对我不起作用。这个问题是Unable to connect to Command Metric Stream 的延续。在 Hystrix Dashboard 问题中。

我的源代码:https ://github.com/javaHelper/spring-cloud-cordinating-services/tree/master/Protecting-Systems-with-Circuit-Breakers

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-01-15 10:46:04.141 ERROR 4380 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field properties in org.springframework.cloud.netflix.turbine.stream.TurbineStreamAutoConfiguration required a bean of type 'org.springframework.cloud.netflix.turbine.stream.TurbineStreamProperties' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'org.springframework.cloud.netflix.turbine.stream.TurbineStreamProperties' in your configuration.

只是试图启动

涡轮::

TurbineApplication.java

@SpringBootApplication
@EnableTurbine
public class TurbineApplication {

    public static void main(String[] args) {
        SpringApplication.run(TurbineApplication.class, args);
    }
}

应用程序属性

server.port=3000
spring.application.name=turbine-aggregator
eureka.client.service-url.defaultZone=http://localhost:8761/eureka
turbine.app-config=weather-app,datetime-app
turbine.cluster-name-expression=new String("default")

在此处输入图像描述

4

2 回答 2

0

从 pom.xml 中删除涡轮流依赖项应该可以解决问题。

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-turbine-stream</artifactId>
</dependency>
于 2020-10-23T16:33:14.627 回答
-1

也许您需要配置 Spring 以启用涡轮机的配置属性?

@Configuration
@EnableConfigurationProperties(TurbineStreamProperties.class)
public class TurbineConfig {
}
于 2020-01-25T10:28:57.003 回答