Spring-Boot和Kafka:如何处理不可用的经纪人? [英] Spring-Boot and Kafka : How to handle broker not available?
问题描述
虽然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的连接.经纪人未必可用.
[org.springframework.kafka.KafkaListenerEndpointContainer#0-0-C-1] WARN o.apache.kafka.clients.NetworkClient - [Consumer clientId=consumer-1, groupId=ResponseReceiveConsumerGroup] Connection to node 2147483647 could not be established. Broker may not be available.
Spring Boot中是否有一种方法可以优雅地处理此问题,而不是在控制台上无限处理日志?
Is there a way in Spring Boot to handle this gracefully instead of infinite logs on console ?
推荐答案
增加 reconnect.backoff.ms
属性(请参见默认仅为50毫秒.
这篇关于Spring-Boot和Kafka:如何处理不可用的经纪人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!