Search in sources :

Example 1 with ClientFactoryBuilder

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();
}
Also used : ClientFactoryBuilder(com.linecorp.armeria.client.ClientFactoryBuilder) Ssl(zipkin2.server.internal.elasticsearch.ZipkinElasticsearchStorageProperties.Ssl) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Qualifier(org.springframework.beans.factory.annotation.Qualifier) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ClientFactoryBuilder (com.linecorp.armeria.client.ClientFactoryBuilder)1 Qualifier (org.springframework.beans.factory.annotation.Qualifier)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1 Ssl (zipkin2.server.internal.elasticsearch.ZipkinElasticsearchStorageProperties.Ssl)1