问题描述
当 spring-boot 应用程序正在运行时,如果我完全关闭代理(kafka 和 zookeeper),我会在控制台中看到这个警告无限长的时间.
While the spring-boot app is running and if I shutdown the broker completely ( both kafka and zookeeper ) I am seeing this warn in console for infinite amount of time.
[org.springframework.kafka.KafkaListenerEndpointContainer#0-0-C-1]警告 o.apache.kafka.clients.NetworkClient - [消费者clientId=consumer-1, groupId=ResponseReceiveConsumerGroup]无法建立到节点 2147483647 的连接.经纪人不得可用.
Spring Boot 有没有办法优雅地处理这个问题,而不是在控制台上无限登录?
Is there a way in Spring Boot to handle this gracefully instead of infinite logs on console ?
推荐答案
增加 reconnect.backoff.ms
属性(请参阅 Kafka 文档).
Increase the reconnect.backoff.ms
property (see Kafka docs).
默认只有 50 毫秒.
The default is only 50ms.
这篇关于Spring-Boot 和 Kafka:如何处理代理不可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!