有没有办法在 Spring Cloud Data Flow 中配置 Kafka 客户端超时设置?

Is there a way to configure the Kafka client timeout settings in Spring Cloud Data Flow?

启动 Spring Cloud Data Flow 流时,由于各种与 Kafka 相关的错误,应用程序经常无法在我的机器上部署。例如: org.springframework.cloud.stream.binder.BinderException: Cannot initialize binder [...] Caused by: kafka.common.KafkaException: fetching topic metadata for topics [Set(xxx)] from broker [List()] failed

但我也看到了这个: kafka.admin.AdminOperationException: replication factor: 1 larger than available brokers: 0

在这两种情况下,Kafka 进程都是 运行(以及 ZooKeeper),因此我假设已通过某种超时阈值。

generic nor the Kafka-specific 配置似乎都没有提供任何超时选项。

有什么方法可以影响 Kafka 客户端放弃并假设代理不存在的时间量?

能否使用./bin/kafka-topics.sh等kafka工具命令获取主题信息?它看起来像是 Kafka 配置问题,而不是可能的超时。

如果您想在 kafka producer/consumer 中设置任何通用属性(如 connect.timeout.ms 等),您可以通过 spring.cloud.stream.kafka.bindings.<channelName>.<producer/consumer>.configuration.<propertyName>=<propertyValue>

来完成

kafka 代理似乎 运行 不正确,您可以尝试使用 bin/kafka-topics.sh --describe --zookeeper <your zookeeper host>:2181 看看你的话题是否同步。