Skip to content

Commit c6588a7

Browse files
author
Yevgeniy Magdel
committed
[allow_configuring_avro_consumer] Debugging / fixes
1 parent 36c89df commit c6588a7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/main/java/kafdrop/util/AvroMessageDeserializer.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,21 @@ private static KafkaAvroDeserializer getDeserializer(String schemaRegistryUrl, S
3838

3939
private static void setConfigFromEnvIfAvailable(String topicName, String configPath, Map<String,Object> config){
4040

41+
System.out.println("-----------STARTING topic name: " + topicName);
4142
String configPrefix = "SCHEMA_REGISTRY";
42-
String topicScopedEnvPath = Arrays.stream(new String[]{configPrefix, configPath.replace(".", "_"), topicName.replace("-", "_") } )
43+
String topicScopedEnvPath = Arrays.stream(new String[]{configPrefix, configPath.replaceAll("\\.", "_"), topicName.replaceAll("-", "_") } )
4344
.map(String::toUpperCase).collect(Collectors.joining("_"));
4445

45-
String noTopicScopedEnvPath = Arrays.stream(new String[]{ "SCHEMA_REGISTRY", configPath.replace(".", "_") })
46+
String noTopicScopedEnvPath = Arrays.stream(new String[]{ configPrefix, configPath.replaceAll("\\.", "_") })
4647
.map(String::toUpperCase).collect(Collectors.joining("_"));
4748

4849
for(String envPath : new String[]{topicScopedEnvPath, noTopicScopedEnvPath}) {
50+
4951
String namingStrategyValue = System.getenv(envPath);
52+
System.out.println("-----------STARTING topic name: " + envPath + " " + namingStrategyValue);
5053
if (namingStrategyValue != null) {
51-
config.put(envPath, namingStrategyValue);
54+
System.out.println("-----------STARTING topic name: " + envPath + " " + namingStrategyValue);
55+
config.put(configPath, namingStrategyValue);
5256
}
5357
}
5458
}

0 commit comments

Comments
 (0)