Skip to content

Commit

Permalink
Update regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ekawinataa committed Sep 3, 2024
1 parent 6c33ff4 commit 8ef873b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.regex.Pattern;

public class SinkKafkaConfigUtil {
private static final Pattern SINK_KAFKA_BUILT_IN_CONFIG_REGEX = Pattern.compile("SINK_KAFKA_BUILT_IN_CONFIG(.*)");
private static final Pattern SINK_KAFKA_BUILT_IN_CONFIG_REGEX = Pattern.compile("SINK_KAFKA_BUILT_IN_CONFIG_(.*)");

public static Properties parseBuiltInKafkaProperties(Configuration configuration) {
Properties properties = new Properties();
Expand All @@ -19,7 +19,9 @@ public static Properties parseBuiltInKafkaProperties(Configuration configuration
for (String key : builtInKeys) {
Matcher matcher = SINK_KAFKA_BUILT_IN_CONFIG_REGEX.matcher(key);
if (matcher.find()) {
String kafkaConfigKey = matcher.group(1);
String kafkaConfigKey = matcher.group(1)
.toLowerCase()
.replaceAll("_", ".");
properties.setProperty(kafkaConfigKey, configuration.getString(key, ""));
}
}
Expand Down

0 comments on commit 8ef873b

Please sign in to comment.