use of io.confluent.kafka.schemaregistry.client.rest.RestService in project flink by apache.
the class CachedSchemaCoderProviderTest method getInternalStateFromRestService.
private <T> T getInternalStateFromRestService(String name, CachedSchemaCoderProvider provider) {
CachedSchemaRegistryClient cachedSchemaRegistryClient = Whitebox.getInternalState(provider.get(), "schemaRegistryClient");
RestService restService = Whitebox.getInternalState(cachedSchemaRegistryClient, "restService");
return Whitebox.getInternalState(restService, name);
}
use of io.confluent.kafka.schemaregistry.client.rest.RestService in project ksql by confluentinc.
the class KsqlSchemaRegistryClientFactory method get.
public SchemaRegistryClient get() {
if (schemaRegistryUrl.equals("")) {
return new DefaultSchemaRegistryClient();
}
final RestService restService = serviceSupplier.get();
// This call sets a default sslSocketFactory.
final SchemaRegistryClient client = schemaRegistryClientFactory.create(restService, 1000, ImmutableList.of(new AvroSchemaProvider(), new ProtobufSchemaProvider(), new JsonSchemaProvider()), schemaRegistryClientConfigs, httpHeaders);
// above.
if (sslContext != null) {
restService.setSslSocketFactory(sslContext.getSocketFactory());
}
return client;
}
use of io.confluent.kafka.schemaregistry.client.rest.RestService in project flink-mirror by flink-ci.
the class CachedSchemaCoderProviderTest method getInternalStateFromRestService.
private <T> T getInternalStateFromRestService(String name, CachedSchemaCoderProvider provider) {
CachedSchemaRegistryClient cachedSchemaRegistryClient = Whitebox.getInternalState(provider.get(), "schemaRegistryClient");
RestService restService = Whitebox.getInternalState(cachedSchemaRegistryClient, "restService");
return Whitebox.getInternalState(restService, name);
}
use of io.confluent.kafka.schemaregistry.client.rest.RestService in project flink by splunk.
the class CachedSchemaCoderProviderTest method getInternalStateFromRestService.
private <T> T getInternalStateFromRestService(String name, CachedSchemaCoderProvider provider) {
CachedSchemaRegistryClient cachedSchemaRegistryClient = Whitebox.getInternalState(provider.get(), "schemaRegistryClient");
RestService restService = Whitebox.getInternalState(cachedSchemaRegistryClient, "restService");
return Whitebox.getInternalState(restService, name);
}
use of io.confluent.kafka.schemaregistry.client.rest.RestService in project schema-registry by confluentinc.
the class CachedSchemaRegistryClientTest method testMultipleCredentialProvider.
@Test(expected = ConfigException.class)
public void testMultipleCredentialProvider() throws Exception {
Map<String, String> config = new HashMap<>();
// Default credential provider
config.put(SchemaRegistryClientConfig.BASIC_AUTH_CREDENTIALS_SOURCE, "URL");
config.put(SchemaRegistryClientConfig.BEARER_AUTH_CREDENTIALS_SOURCE, "STATIC_TOKEN");
config.put(SchemaRegistryClientConfig.BEARER_AUTH_TOKEN_CONFIG, "auth-token");
// Throws ConfigException if both credential providers are fully configured.
new CachedSchemaRegistryClient(// Sets initial credential set for URL provider
new RestService("http://user:password@sr.com:8020"), CACHE_CAPACITY, config, null);
}
Aggregations