use of io.confluent.ksql.properties.LocalProperties in project ksql by confluentinc.
the class InternalKsqlClientFactory method createInternalClient.
public static KsqlClient createInternalClient(final Map<String, String> clientProps, final BiFunction<Integer, String, SocketAddress> socketAddressFactory, final Vertx vertx) {
final String internalClientAuth = clientProps.get(KsqlRestConfig.KSQL_INTERNAL_SSL_CLIENT_AUTHENTICATION_CONFIG);
final boolean verifyHost = !Strings.isNullOrEmpty(internalClientAuth) && !KsqlRestConfig.SSL_CLIENT_AUTHENTICATION_NONE.equals(internalClientAuth);
return new KsqlClient(Optional.empty(), new LocalProperties(ImmutableMap.of()), httpOptionsFactory(clientProps, verifyHost, InternalKsqlClientFactory::createClientOptions), httpOptionsFactory(clientProps, verifyHost, InternalKsqlClientFactory::createClientOptionsHttp2), socketAddressFactory, vertx);
}
use of io.confluent.ksql.properties.LocalProperties in project ksql by confluentinc.
the class KsqlClientTest method shouldFailWithNonHttp2Options.
@Test
public void shouldFailWithNonHttp2Options() {
// When:
final IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> new KsqlClient(new HashMap<>(), Optional.empty(), new LocalProperties(properties), new HttpClientOptions().setVerifyHost(false), Optional.of(new HttpClientOptions())));
// Then:
assertThat(e.getMessage(), containsString("Expecting http2 protocol version"));
}
use of io.confluent.ksql.properties.LocalProperties in project ksql by confluentinc.
the class KsqlRestClient method create.
@VisibleForTesting
static KsqlRestClient create(final String serverAddress, final Map<String, ?> localProps, final Map<String, String> clientProps, final Optional<BasicCredentials> creds, final Optional<BasicCredentials> ccloudApiKey, final KsqlClientSupplier clientSupplier, final ConsistencyLevel consistencyLevel) {
final LocalProperties localProperties = new LocalProperties(localProps);
final KsqlClient client = clientSupplier.get(clientProps, creds, localProperties);
return new KsqlRestClient(client, serverAddress, localProperties, ccloudApiKey, consistencyLevel);
}
Aggregations