# How to create a new ElasticsearchHttpClient class implementing org.elasticache.client.Client to enable ES applications to run against AWS Elasticsearch?

**URL:** https://discuss.elastic.co/t/how-to-create-a-new-elasticsearchhttpclient-class-implementing-org-elasticache-client-client-to-enable-es-applications-to-run-against-aws-elasticsearch/39348
**Category:** Elasticsearch
**Created:** [January 15, 2016, 4:40pm UTC](https://discuss.elastic.co/t/how-to-create-a-new-elasticsearchhttpclient-class-implementing-org-elasticache-client-client-to-enable-es-applications-to-run-against-aws-elasticsearch/39348 "2016-01-15T16:40:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ingo\_Jaeckel](https://avatars.discourse-cdn.com/v4/letter/i/c37758/32.png) [@Ingo\_Jaeckel](https://discuss.elastic.co/u/Ingo_Jaeckel)
#### Post date: [January 15, 2016, 4:40pm UTC](https://discuss.elastic.co/t/how-to-create-a-new-elasticsearchhttpclient-class-implementing-org-elasticache-client-client-to-enable-es-applications-to-run-against-aws-elasticsearch/39348/1 "2016-01-15T16:40:13Z")

</div>

I am trying to add Elasticsearch HTTP access to the [Titan ES client](https://github.com/thinkaurelius/titan/blob/titan10/titan-es/src/main/java/com/thinkaurelius/titan/diskstorage/es/ElasticSearchIndex.java#L334) using [JEST](https://github.com/searchbox-io/Jest). titan-es only supports ES' local and transport (TCP) mode. But I would like to support communication over ES' HTTP interface. That would allow client libraries like `titan-es` to use [AWS Elasticsearch](https://aws.amazon.com/elasticsearch-service/) as an indexing backend which only provides a HTTP(S) interface. See [this post](https://groups.google.com/forum/#!topic/aureliusgraphs/tVSw7UiyEyg) for more information.

I am looking for some feedback on the approach I am considering so far:

1. Create a new class `ElasticsearchHttpClient` that implements the `org.elasticache.client.Client` interface. The new class will use the `JestClient` as it's internal client. This way it will communicate with ES over HTTP. The new class will likely extend ES' `AbstractClient` to reduce the methods that have to be implemented to: `admin()`, `settings()`, `execute()`, `threadPool()`, and `close()`.
2. Add a new enum `HTTP_CLIENT` to `ElasticSearchSetup`
3. Ensure that the `connect()` method on `HTTP_CLIENT` returns an instance of `Connection` which contains proper values for `node` and `client`. The `client` member would be an instance of the new `ElasticsearchHttpClient` class.
4. Ensure that `ElasticSearchIndex.interfaceConfiguration()` method retrieves the correct instance of `Connection` (containing the new `ElasticsearchHttpClient`) if the `INTERFACE` is configured as `HTTP_CLIENT`. From that point on the rest of the code should continue to work over the new protocol.

Does that sound like it should work? The 1st step is my biggest concern - I am not confident that I can implement all Client methods using the JestClient.

Has somebody tried this before?

Thanks,  
Ingo

---

<div class="post-metadata">

### Author: ![Ingo\_Jaeckel](https://avatars.discourse-cdn.com/v4/letter/i/c37758/32.png) [@Ingo\_Jaeckel](https://discuss.elastic.co/u/Ingo_Jaeckel)
#### Post date: [January 19, 2016, 9:26pm UTC](https://discuss.elastic.co/t/how-to-create-a-new-elasticsearchhttpclient-class-implementing-org-elasticache-client-client-to-enable-es-applications-to-run-against-aws-elasticsearch/39348/2 "2016-01-19T21:26:27Z")

</div>

This was answered on the [Titan mailing list](https://groups.google.com/forum/#!msg/aureliusgraphs/70_AAPASlzo/nd60lM3WAAAJ).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 11:23pm UTC](https://discuss.elastic.co/t/how-to-create-a-new-elasticsearchhttpclient-class-implementing-org-elasticache-client-client-to-enable-es-applications-to-run-against-aws-elasticsearch/39348/3 "2017-07-05T23:23:15Z")

</div>


