com.graphaware.module.es.util.CustomJestClientFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neo4j-to-elasticsearch Show documentation
Show all versions of neo4j-to-elasticsearch Show documentation
GraphAware Framework Module for Integrating Neo4j with Elasticsearch
package com.graphaware.module.es.util;
import io.searchbox.client.JestClientFactory;
import io.searchbox.client.config.HttpClientConfig;
import org.apache.http.impl.client.HttpClientBuilder;
/**
* Customizations:
* - connectionManagerShared: true
* - readTimeout: 20s
* - connTimeout: 10s
*/
public class CustomJestClientFactory extends JestClientFactory {
@Override
protected HttpClientBuilder configureHttpClient(HttpClientBuilder builder) {
return builder
.setConnectionManagerShared(true);
}
@Override
public void setHttpClientConfig(HttpClientConfig httpClientConfig) {
super.setHttpClientConfig(new HttpClientConfig.Builder(httpClientConfig)
.readTimeout(20000) // 20s
.connTimeout(10000) // 10s
.build()
);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy