Elasticsearch REST JAVA API


Elasticsearch 5 provides low level client api’s to communicate with Elasticsearch Cluster over HTTP by JAVA. Because of REST services and JSON able to communicate with all version of Elasticseach and across firewall also.

Elasticsearch REST Client sent http requests internally by using Apache Http Async Client.

In case of version change on Elasticsearch Cluster no need to change for client and will not impact any communication.

Initial Release Version : 5.0.0-alpha4

Elasticsearch REST Features

  • Keep connection persistent.
  • Logged request and response by Elasticsearch Rest API.
  • Load balancing across all available nodes.
  • Failover incase of node fail and upon specific response codes.
  • Provide sniffing to discovery of clusters node.
  • Minimum Dependencies.

Pre-Requisite

Elasticsearch Rest required minimum Java version is 1.7

Elasticsearch REST Java API Configuration

 Maven Configuration

Add below dependency in pom.xml file to import all library.

.<dependency>
      <groupId>org.elasticsearch.client</groupId>
      <artifactId>rest</artifactId>
      <version>5.1.2</version>
</dependency>

Gradle Configuration

Add below dependency in build.gradle file to import all library.

dependencies {   compile 'org.elasticsearch.client:rest:5.1.2'}

Read More on Elasticsearch REST

Integration

Integrate Filebeat, Kafka, Logstash, Elasticsearch and Kibana

About Saurabh Gupta

My Name is Saurabh Gupta, I have approx. 10 Year of experience in Information Technology World manly in Java/J2EE. During this time I have worked with multiple organization with different client, so many technology, frameworks etc.
This entry was posted in Elasticsearch, REST and tagged , , . Bookmark the permalink.