我们如何在 spring kafka 属性文件中定义 kafka request.timeout.ms 属性

How do we define kafka request.timeout.ms property in spring kafka properties file

我尝试通过以下两种方式定义 request.timeout.ms 属性 :-

application.properties

1. spring.kafka.consumer.request.timeout.ms=60000 
2. spring.kafka.consumer.request-timeout-ms=60000

但是,当我启动消费者服务时,我可以看到它没有覆盖值

我对 属性 的定义是否正确???或者需要在某处添加 override 属性???

spring.kafka.consumer.properties[request.timeout.ms]=60000

对于 ConsumerProperties,您可以在此处查看:https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/kafka/KafkaProperties.Consumer.html

如果在上面 class 中可以找到任何 Kafka 消费者属性,请将其放入 properties

https://docs.spring.io/spring-boot/docs/current/reference/html/messaging.html#messaging.kafka.additional-properties

The properties supported by auto configuration are shown in application-properties.html. Note that, for the most part, these properties (hyphenated or camelCase) map directly to the Apache Kafka dotted properties. See the Apache Kafka documentation for details.

The first few of these properties apply to all components (producers, consumers, admins, and streams) but can be specified at the component level if you wish to use different values. Apache Kafka designates properties with an importance of HIGH, MEDIUM, or LOW. Spring Boot auto-configuration supports all HIGH importance properties, some selected MEDIUM and LOW properties, and any properties that do not have a default value.

Only a subset of the properties supported by Kafka are available directly through the KafkaProperties class. If you wish to configure the producer or consumer with additional properties that are not directly supported, use the following properties:

spring.kafka.properties[prop.one]=first
spring.kafka.admin.properties[prop.two]=second
spring.kafka.consumer.properties[prop.three]=third
spring.kafka.producer.properties[prop.four]=fourth
spring.kafka.streams.properties[prop.five]=fifth