Spring-Boot and Kafka : How to handle broker not available?

和自甴很熟 提交于 2020-01-03 14:53:27

问题


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] 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.

Is there a way in Spring Boot to handle this gracefully instead of infinite logs on console ?


回答1:


Increase the reconnect.backoff.ms property (see Kafka docs).

The default is only 50ms.



来源:https://stackoverflow.com/questions/51794192/spring-boot-and-kafka-how-to-handle-broker-not-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!