Fix KafkaBinderHealthIndicator return Down Error

When we set enable.auto.commit to true, the actuator/health returns DOWN status.

For more details see this: https://github.com/spring-cloud/spring-cloud-stream/pull/2504#issue-1361385289

Update KafkaBinderConfigurationProperties.java

Polish commit
This commit is contained in:
Ginkgo
2022-09-05 12:05:25 +08:00
committed by Soby Chacko
parent c670efdc08
commit bc973e3462

View File

@@ -411,7 +411,7 @@ public class KafkaBinderConfigurationProperties {
private void filterStreamManagedConfiguration(Map<String, Object> configuration) {
if (configuration.containsKey(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG)
&& configuration.get(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG).equals(true)) {
&& configuration.get(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG).toString().equalsIgnoreCase("true")) {
logger.warn(constructIgnoredConfigMessage(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG) +
ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG + "=true is not supported by the Kafka binder");
configuration.remove(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG);