简体   繁体   English

使用 application.yml/properties 的批处理侦听器的 Spring kafka 集成属性

[英]Spring kafka integration properties for batch listener using application.yml/properties

I am trying to use kafka consumer batching in spring boot app.我正在尝试在 Spring Boot 应用程序中使用 kafka 消费者批处理。 I could see examples, where we have a kafka config class in which, KafkaListenerContainerFactory is configured and我可以看到示例,其中我们有一个 kafka 配置类,其中配置了KafkaListenerContainerFactory

ConcurrentKafkaListenerContainerFactory.setBatchListener(true);

is enabled.已启用。 i am just wondering if this can be achieved without a factory class, ie by using spring kafka integration properties in application.yml.我只是想知道这是否可以在没有工厂类的情况下实现,即通过在 application.yml 中使用 spring kafka 集成属性。 Earlier i had defined a factory and replaced it with spring kafa integration properties via application.yml for concise code.早些时候我已经定义了一个工厂,并通过 application.yml 用 spring kafa 集成属性替换它以获得简洁的代码。 I am trying to understand if the latter has limitations and usage of a config class is preferable, as i am unable to achieve batching using spring kafa integration properties via application.yml.我试图了解后者是否有限制,并且最好使用配置类,因为我无法通过 application.yml 使用 spring kafa 集成属性实现批处理。 https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html I referred this doc to see available options. https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html我参考了这个文档来查看可用选项。

spring.kafka.listener.type=batch (Vs. single - the default). spring.kafka.listener.type=batch (与single -默认)。

The Boot documentation could use some improvement.引导文档可以使用一些改进。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring Boot - 从 application.yml 和 application.properties 注入 - Spring Boot - inject from application.yml and application.properties Spring Boot application.yml和application.properties - Spring Boot application.yml and application.properties Unicode 转义字符未在 Spring application.yml 属性中解析 - Unicode escape characters are not getting parsed in Spring application.yml properties 从 application.yml 读取属性时忽略 Spring 配置文件 - Spring profile is ignored when reading properties from application.yml "'application.yml' 中的 Spring Boot 属性未从 JUnit 测试加载" - Spring Boot properties in 'application.yml' not loading from JUnit Test Spring 引导 2 忽略在 application.yml 中设置的 HikariCP 属性 - Spring Boot 2 is ignoring HikariCP properties set in application.yml 根据application.yml的属性注入Spring Boot - Inject with Spring Boot depending on properties from application.yml Java Spring 引导自定义属性在 application.yml 中不起作用 - Java Spring Boot custom properties dont work in application.yml 无法使用@ Configuration.properties读取application.yml - Can't read application.yml using @Configuration.properties Spring Boot - 如何将 application.yml 属性定义为 application.properties - Spring Boot - How to define application.yml properties as application.properties
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM