use of com.linecorp.armeria.client.ClientFactoryBuilder in project zipkin by openzipkin.
the class ZipkinElasticsearchStorageConfiguration method esClientFactory.
// exposed as a bean so that we can test TLS by swapping it out.
// TODO: see if we can override the TLS via properties instead as that has less surface area.
@Bean
@Qualifier(QUALIFIER)
@ConditionalOnMissingBean
ClientFactory esClientFactory(ZipkinElasticsearchStorageProperties es, MeterRegistry meterRegistry) throws Exception {
ClientFactoryBuilder builder = ClientFactory.builder();
Ssl ssl = es.getSsl();
if (ssl.isNoVerify())
builder.tlsNoVerify();
// Allow use of a custom KeyStore or TrustStore when connecting to Elasticsearch
if (ssl.getKeyStore() != null || ssl.getTrustStore() != null)
configureSsl(builder, ssl);
// TODO: find or raise a bug with Elastic
return builder.useHttp2Preface(false).connectTimeoutMillis(es.getTimeout()).meterRegistry(meterRegistry).build();
}
Aggregations