首页 > 解决方案 > 为什么camel kafka autoconfig有两个allow-manual-commit设置?

问题描述

我的 spring boot 属性文件中有两个配置,并且正在使用 camel 2.23:

#camel.component.kafka.allow-manual-commit=true     <-- works when i uncomment and use
###Why isnt the below option being picked up??
camel.component.kafka.configuration.allow-manual-commit=true  <-- not working 

似乎当我使用camel.component.kafka.allow-manual-commit=true而不是.configuration扩展名称空间时......一切正常。但是当我使用配置之一时,它失败了......即它没有检测到 allowManualCommit 为真

我在第 31 行查看了这个camel-kafka-starter的代码,并注意到它被注释为指向camel.component.kafka命名空间。这是有道理的,但是 .configuration 命名空间是从哪里来的……camel.component.kafka.allow-manual-commit 的默认“false”值是否覆盖了我在 camel.component.kafka.configuration 上设置的 true 值。允许手动提交?

在我的代码中,我有一条骆驼路线

from("kafka?{topic}")

和其他地方我正在使用KafkaManualCommit对象来 commitSync()

标签: javaspring-bootapache-kafkaapache-camel

解决方案


推荐阅读