2022-02-04 15:52:49 +01:00
|
|
|
package eu.dnetlib.scholix.api;
|
|
|
|
|
2022-02-08 09:57:45 +01:00
|
|
|
import eu.dnetlib.scholix.api.index.ElasticSearchPool;
|
2022-02-07 16:36:26 +01:00
|
|
|
import eu.dnetlib.scholix.api.index.ElasticSearchProperties;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2022-02-04 15:52:49 +01:00
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
|
|
@Configuration
|
2022-02-08 09:57:45 +01:00
|
|
|
public class RestClientConfig {
|
2022-02-04 15:52:49 +01:00
|
|
|
|
2022-02-07 16:36:26 +01:00
|
|
|
@Autowired
|
|
|
|
private ElasticSearchProperties elasticSearchProperties;
|
|
|
|
|
2022-02-08 09:57:45 +01:00
|
|
|
|
2022-02-04 15:52:49 +01:00
|
|
|
@Bean
|
2022-02-08 09:57:45 +01:00
|
|
|
public ElasticSearchPool connectionPool() {
|
|
|
|
|
2022-02-09 11:33:09 +01:00
|
|
|
elasticSearchProperties.setMaxIdle(5);
|
|
|
|
elasticSearchProperties.setMaxTotal(10);
|
2022-02-08 09:57:45 +01:00
|
|
|
ElasticSearchPool pool = new ElasticSearchPool(elasticSearchProperties);
|
|
|
|
return pool;
|
2022-02-04 15:52:49 +01:00
|
|
|
}
|
2022-02-08 09:57:45 +01:00
|
|
|
|
|
|
|
|
2022-02-04 15:52:49 +01:00
|
|
|
}
|