Skip to content

Commit

Permalink
Avoid StringIndexOutOfBoundsException in KafkaRuntimeConfigProducer
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed May 21, 2024
1 parent 589cf47 commit 46b1e27
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public Map<String, Object> createKafkaRuntimeConfig(Config config, ApplicationCo
if (!propertyNameLowerCase.startsWith(CONFIG_PREFIX) || propertyNameLowerCase.startsWith(UI_CONFIG_PREFIX)) {
continue;
}
if (propertyNameLowerCase.length() <= CONFIG_PREFIX.length()) {
continue;
}
// Replace _ by . - This is because Kafka properties tend to use . and env variables use _ for every special
// character. So, replace _ with .
String effectivePropertyName = propertyNameLowerCase.substring(CONFIG_PREFIX.length() + 1).toLowerCase()
Expand Down

0 comments on commit 46b1e27

Please sign in to comment.