Commit d18a3781 authored by shiyu's avatar shiyu

ES链接设置最小空闲时间

parent 6d38479f
......@@ -108,7 +108,8 @@ public class ElasticSearchConfig {
HttpClientConfigCallback callback = httpAsyncClientBuilder -> httpAsyncClientBuilder
.setSSLContext(buildSSLContext())
.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
.setDefaultCredentialsProvider(credentialsProvider);
.setDefaultCredentialsProvider(credentialsProvider)
.setKeepAliveStrategy((response, context) -> 180 * 1000);
// 用builder创建RestClient对象
RestClient client = RestClient
......
......@@ -42,8 +42,6 @@ public class ItemEsDao {
//来源中国,排除2,7,尚未去除水印的
private final static List<String> SOURCE_LIST = Arrays.asList("1", "3", "8", "11", "1000");
@Resource(name="clientByPasswd")
ElasticsearchClient elasticsearchClient;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment