当前位置 : 主页 > 编程语言 > java >

elasticsearch rest client

来源:互联网 收集:自由互联 发布时间:2021-06-28
gistfile1.txt @Configurationpublic class ESConfiguration { @Bean public RestClient restClient() { return RestClient.builder(new HttpHost("apm-server", 9200, "http")) .setRequestConfigCallback(requestConfigBuilder - requestConfigBuilder.setC
gistfile1.txt
@Configuration
public class ESConfiguration {

    @Bean
    public RestClient restClient() {
        return RestClient.builder(new HttpHost("apm-server", 9200, "http"))
                .setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(60000)
                        .setSocketTimeout(60000))
                .setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setDefaultIOReactorConfig(
                        IOReactorConfig.custom().setIoThreadCount(4).build()))
                .setMaxRetryTimeoutMillis(60000)
                .build();
    }

}
网友评论