我有一个Spring Boot应用程序,带有用于Apache Kafka的Spring,用于将消息发送到kafka集群上的主题。我已自动为 delivery.timeout.ms 连接属性,并且在应用程序启动并配置了生产者之后,应用程序日志显示该属性的值未设置,并给出了警告:{{1} }
我已经检查了我的POM,并确认我正在使用以下两个依赖项:
"WARN [task-scheduler-1] org.apache.kafka.clients.producer.ProducerConfig [] --- The configuration 'delivery.timeout.ms' was supplied but isn't a known config"
我也已确认该属性存在于2.1.0版本中:https://kafka.apache.org/21/javadoc/org/apache/kafka/clients/producer/ProducerConfig.html
我看到带有其他属性类似警告的帖子,其中提到可以忽略该属性;但是,我的应用程序遇到了不良行为,可以通过根据其描述设置此属性来纠正该错误。
答案 0 :(得分:0)
看起来您的kafka-clients版本覆盖无效。我刚刚对其进行了测试,并且工作正常(使用spring-kafka 2.2.9和2.1.1客户端):
ProducerConfig values:
acks = 1
batch.size = 16384
bootstrap.servers = [localhost:9092]
buffer.memory = 33554432
client.dns.lookup = default
client.id =
compression.type = none
connections.max.idle.ms = 540000
delivery.timeout.ms = 123456
enable.idempotence = false
...
尝试遵循instructions in the Spring for Apache Kafka reference manual来覆盖所有kafka客户端库。