August 2019
Intermediate to advanced
560 pages
13h 41m
English
Create a RestClientBuilder instance by using the static builder() method of the RestClient class with a host environment. Then, call the build() method of the RestClientBuilder instance to build the RestClient instance. Our example is shown in the following code block:
public RestClient LowLevelRestClient() { return RestClient.builder(new HttpHost("localhost", 9200, "http")) .setDefaultHeaders(new Header[] { new BasicHeader("accept","application/json"), new BasicHeader("content-type","application/json")}) .setFailureListener(new RestClient.FailureListener() { public void onFailure(Node node) { logger.error("Low level Rest Client Failure on node " + node.getName());} }).build(); }
RestClientBuilder provides a ...
Read now
Unlock full access