Skip to content

Commit c321e25

Browse files
author
Jerome Revillard
committed
Use all 'SCHEMA_REGISTRY_' prefixed env variable as config
1 parent e19178c commit c321e25

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/devshawn/kafka/gitops/config/SchemaRegistryConfigLoader.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ private static void setConfig(SchemaRegistryConfig.Builder builder) {
4040
config.put(SCHEMA_REGISTRY_URL_KEY, value);
4141
} else if (key.equals(SCHEMA_DIRECTORY_KEY)) {
4242
config.put(SCHEMA_DIRECTORY_KEY, value);
43-
}
43+
} else if (key.startsWith("SCHEMA_REGISTRY_")) {
44+
String newKey = key.replace("_", ".").toLowerCase();
45+
config.put(newKey, value);
46+
}
4447
});
4548

4649
handleDefaultConfig(config);

src/main/java/com/devshawn/kafka/gitops/service/SchemaRegistryService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public CachedSchemaRegistryClient createSchemaRegistryClient() {
190190
saslBasicAuthCredentialProvider.configure(clientConfig);
191191
restService.setBasicAuthCredentialProvider(saslBasicAuthCredentialProvider);
192192
}
193-
return new CachedSchemaRegistryClient(restService, 10);
193+
return new CachedSchemaRegistryClient(restService, 10, config.getConfig());
194194
}
195195

196196
}

0 commit comments

Comments
 (0)