use of io.searchbox.client.JestClientFactory in project xwiki-platform by xwiki.
the class DefaultJestClientManager method initialize.
@Override
public void initialize() throws InitializationException {
String pingURL = this.configuration.getPingInstanceURL();
HttpClientConfig clientConfig = new HttpClientConfig.Builder(pingURL).multiThreaded(true).build();
JestClientFactory factory = new XWikiJestClientFactory(this.configuration);
factory.setHttpClientConfig(clientConfig);
this.client = factory.getObject();
}
use of io.searchbox.client.JestClientFactory in project vboard by voyages-sncf-technologies.
the class ElasticSearchClient method lazyGetElsClient.
// Lazy initialization because we want to be able to instantiate this bean without an ElasticSearch server beeing available
public JestHttpClient lazyGetElsClient() {
if (this.elasticSearchClient == null) {
final JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig.Builder(this.elsConfig.getServerUri()).multiThreaded(true).build());
this.elasticSearchClient = (JestHttpClient) factory.getObject();
}
return this.elasticSearchClient;
}
use of io.searchbox.client.JestClientFactory in project jmxtrans by jmxtrans.
the class ElasticWriter method createJestClient.
private JestClient createJestClient(String connectionUrl, String username, String password) {
log.info("Create a jest elastic search client for connection url [{}]", connectionUrl);
JestClientFactory factory = new JestClientFactory();
HttpClientConfig httpClientConfig;
if (username != null) {
log.info("Using HTTP Basic Authentication");
httpClientConfig = new HttpClientConfig.Builder(connectionUrl).defaultCredentials(username, password).multiThreaded(true).build();
} else {
httpClientConfig = new HttpClientConfig.Builder(connectionUrl).multiThreaded(true).build();
}
factory.setHttpClientConfig(httpClientConfig);
return factory.getObject();
}
use of io.searchbox.client.JestClientFactory in project dq-easy-cloud by dq-open-cloud.
the class TransportClient method getClient.
@Before
public void getClient() throws Exception {
JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig.Builder("http://120.78.74.169:9200").gson(new GsonBuilder().setDateFormat("yyyy-MM-dd'T'hh:mm:ss").create()).connTimeout(1500).readTimeout(3000).multiThreaded(true).build());
jestClient = factory.getObject();
}
Aggregations