java - KafkaProducer 在应用程序启动时停止,说 "Closing the Kafka producer with timeoutMillis = 30000 ms"

标签 java spring-boot spring-cloud-stream spring-kafka

我正在尝试运行自定义 Spring Cloud Stream 应用程序启动器,并获取以下信息日志,

2017-11-14 14:59:24.600  INFO 30300 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka version : 0.10.1.1
2017-11-14 14:59:24.600  INFO 30300 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka commitId : f10ef2720b03b247
2017-11-14 14:59:24.747  INFO 30300 --- [           main] o.a.k.clients.producer.KafkaProducer     : Closing the Kafka producer with timeoutMillis = 30000 ms.
2017-11-14 14:59:24.768  INFO 30300 --- [           main] o.s.integration.channel.DirectChannel    : Channel 'websocket-source.output' has 1 subscriber(s).
2017-11-14 14:59:24.773  INFO 30300 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
2017-11-14 14:59:24.906  INFO 30300 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel

我的问题是我的应用程序没有按预期工作(我无法连接到该应用程序将启动的 websocket 服务器),因此我希望从 kafka 日志中获得一些线索。可能缺少一些依赖项,但我找不到。

这是一个错误吗?我该如何调试?

最佳答案

当你构建 Spring Boot Web 应用程序时,你应该记住默认情况下安全性是打开的 - HTTP 基本授权

默认用户是,错误,用户

您可以在日志中找到的生成密码。例如:

2017-11-14 11:56:09.756  INFO 7304 --- [           main] b.a.s.AuthenticationManagerConfiguration :

Using default security password: 396c8870-f36e-44a5-aaea-735d5a8e950a

虽然您也可以将其关闭。例如命令行参数:

--security.basic.enabled=false

https://docs.spring.io/spring-boot/docs/1.5.8.RELEASE/reference/htmlsingle/#howto-switch-off-spring-boot-security-configuration

关于java - KafkaProducer 在应用程序启动时停止,说 "Closing the Kafka producer with timeoutMillis = 30000 ms",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47283166/

相关文章:

java - 如何在 Spring 禁用将 ZonedDateTime 字段的时区转换为 UTC,仅针对一个字段并保留所有其他字段?

java - Spring Cloud Stream保持kafka套接字连接处于 Activity 状态

java - XMLStreamReader 无法读取完整标签

java - Android开发-内部类中的变量

java - 如何使用 Angular 从java接收文件csv

java - Spring Boot 1.4 测试 : Configuration error: found multiple declarations of @BootstrapWith

java - Spring Cloud Stream不使用Kafka channel 绑定(bind)器发送消息

spring-cloud-stream - Spring Cloud stream kinesis binder 消费者群体 - kcl vs dynamodb store

java - JDialog - "line break"在组件之间

java - 动态添加textField时的setlayout