【问题标题】:Field properties in org.springframework.cloud.netflix.turbine.stream.TurbineStreamAutoConfiguration required a bean of typeorg.springframework.cloud.netflix.turbine.stream.TurbineStreamAutoConfiguration 中的字段属性需要一个 bean 类型
【发布时间】:2020-05-01 20:56:46
【问题描述】:

我浏览了如下链接:Spring Boot + Eureka Server + Hystrix with Turbine: empty turbine.stream,但仍然没有为我工作。这个问题是 Unable to connect to Command Metric Stream. in Hystrix Dashboard issue 的延续。

我的源码: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);
    }
}

application.properties

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")

【问题讨论】:

    标签: spring hystrix turbine hystrix-dashboard


    【解决方案1】:

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

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-turbine-stream</artifactId>
    </dependency>
    

    【讨论】:

      【解决方案2】:

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

      @Configuration
      @EnableConfigurationProperties(TurbineStreamProperties.class)
      public class TurbineConfig {
      }
      

      【讨论】:

      猜你喜欢
      • 2021-03-04
      • 1970-01-01
      • 2019-10-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多