use of io.confluent.kafkarest.config.SchemaRegistryConfig in project kafka-rest by confluentinc.
the class DefaultKafkaRestContext method getSchemaRegistryClient.
@Override
public SchemaRegistryClient getSchemaRegistryClient() {
if (!config.isSchemaRegistryEnabled()) {
return null;
}
if (schemaRegistryClient == null) {
SchemaRegistryConfig schemaRegistryConfig = new SchemaRegistryConfig(config.getSchemaRegistryConfigs());
List<String> schemaRegistryUrls = schemaRegistryConfig.getSchemaRegistryUrls().stream().map(URI::create).map(Object::toString).collect(Collectors.toList());
schemaRegistryClient = new CachedSchemaRegistryClient(schemaRegistryUrls, schemaRegistryConfig.getMaxSchemasPerSubject(), SCHEMA_PROVIDERS, config.getSchemaRegistryConfigs(), schemaRegistryConfig.requestHeaders());
}
return schemaRegistryClient;
}
Aggregations