春云流和卡夫卡。
添加以下依赖项后,将显示此错误。 (如果我注释掉@EnableBinding(Source.class),一切正常。)
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
</dependency>
当我添加启用绑定属性时,
@SpringBootApplication
@EnableBinding(Source.class)
public class CustomersServiceApplication {
public static void main(String[] args) {
SpringApplication.run(CustomersServiceApplication.class, args);
}
}
这些是我的财产
spring:
application:
name : customerservice
cloud:
stream:
bindings:
output:
destination: orgChangeTopic
content-type: application/json
kafka:
binder:
zkNodes: localhost
brokers: localhost
logging:
level:
com.netflix: WARN
org.springframework.web: WARN
com.thoughtmechanix: DEBUG
eureka:
instance:
preferIpAddress: true
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://localhost:8761/eureka/
server:
port: 7000
这是我的完整代码,但是当我现在运行应用程序时,我收到了一个错误。
2019-04-08 15:40:33.325 INFO 22917 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-04-08 15:40:33.336 ERROR 22917 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'server.error.include-stacktrace' to org.springframework.boot.autoconfigure.web.ErrorProperties$IncludeStacktrace:
Property: server.error.include-stacktrace
Value: ALWAYS
Origin: "server.error.include-stacktrace" from property source "devtools"
Reason: 0
Action:
Update your application's configuration
将属性添加到我的属性文件后。我仍然得到同样的错误
server:
port: 7000
error:
include-stacktrace : ALWAYS
它看起来像春天版本冲突问题。这里有两个建议: