Skip to content

Commit

Permalink
Set default Kafka auto offset explicitly if it is not provided in con…
Browse files Browse the repository at this point in the history
…figuration (#1992)

Set default Kafka auto offset explicitly if it is not defined (#1992)
  • Loading branch information
obermeier committed Oct 3, 2023
1 parent 59a59a8 commit fa25df8
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,17 @@ public static KafkaConfig getConfig(IStaticPropertyExtractor extractor, boolean
new KafkaSecurityUnauthenticatedPlainConfig();
}

// Set default value if no value is provided.
if (alternatives == null) {
AutoOffsetResetConfig autoOffsetResetConfig = new AutoOffsetResetConfig(KafkaConnectUtils.LATEST);

return new KafkaConfig(brokerUrl, port, topic, securityConfig, autoOffsetResetConfig);
} else {
String auto = extractor.selectedAlternativeInternalId(AUTO_OFFSET_RESET_CONFIG);
AutoOffsetResetConfig autoOffsetResetConfig = new AutoOffsetResetConfig(auto);

String auto = extractor.selectedAlternativeInternalId(AUTO_OFFSET_RESET_CONFIG);
AutoOffsetResetConfig autoOffsetResetConfig = new AutoOffsetResetConfig(auto);
return new KafkaConfig(brokerUrl, port, topic, securityConfig, autoOffsetResetConfig);
}

return new KafkaConfig(brokerUrl, port, topic, securityConfig, autoOffsetResetConfig);
}
Expand Down

0 comments on commit fa25df8

Please sign in to comment.