Skip to content

Commit

Permalink
Merge pull request #40741 from gsmet/fix-kafka-env
Browse files Browse the repository at this point in the history
Avoid StringIndexOutOfBoundsException in KafkaRuntimeConfigProducer
  • Loading branch information
gsmet authored May 22, 2024
2 parents 4348e48 + 46b1e27 commit 578e3bf
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 578e3bf

Please sign in to comment.