I am trying to add Elasticsearch HTTP access to the Titan ES client using 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 as an indexing backend which only provides a HTTP(S) interface. See this post for more information.
I am looking for some feedback on the approach I am considering so far:
- Create a new class
ElasticsearchHttpClient
that implements theorg.elasticache.client.Client
interface. The new class will use theJestClient
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()
, andclose()
. - Add a new enum
HTTP_CLIENT
toElasticSearchSetup
- Ensure that the
connect()
method onHTTP_CLIENT
returns an instance ofConnection
which contains proper values fornode
andclient
. Theclient
member would be an instance of the newElasticsearchHttpClient
class. - Ensure that
ElasticSearchIndex.interfaceConfiguration()
method retrieves the correct instance ofConnection
(containing the newElasticsearchHttpClient
) if theINTERFACE
is configured asHTTP_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