Commit d18a3781 authored by shiyu's avatar shiyu

ES链接设置最小空闲时间

parent 6d38479f
...@@ -108,7 +108,8 @@ public class ElasticSearchConfig { ...@@ -108,7 +108,8 @@ public class ElasticSearchConfig {
HttpClientConfigCallback callback = httpAsyncClientBuilder -> httpAsyncClientBuilder HttpClientConfigCallback callback = httpAsyncClientBuilder -> httpAsyncClientBuilder
.setSSLContext(buildSSLContext()) .setSSLContext(buildSSLContext())
.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
.setDefaultCredentialsProvider(credentialsProvider); .setDefaultCredentialsProvider(credentialsProvider)
.setKeepAliveStrategy((response, context) -> 180 * 1000);
// 用builder创建RestClient对象 // 用builder创建RestClient对象
RestClient client = RestClient RestClient client = RestClient
......
...@@ -42,8 +42,6 @@ public class ItemEsDao { ...@@ -42,8 +42,6 @@ public class ItemEsDao {
//来源中国,排除2,7,尚未去除水印的 //来源中国,排除2,7,尚未去除水印的
private final static List<String> SOURCE_LIST = Arrays.asList("1", "3", "8", "11", "1000"); private final static List<String> SOURCE_LIST = Arrays.asList("1", "3", "8", "11", "1000");
@Resource(name="clientByPasswd") @Resource(name="clientByPasswd")
ElasticsearchClient elasticsearchClient; 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