flummi icon indicating copy to clipboard operation
flummi copied to clipboard

Use Elasticsearch 5.x Low-Level REST client

Open joschi opened this issue 7 years ago • 5 comments

Elasticsearch 5.0.0 introduced the low-level Java REST client which is based on Apache HttpComponents and, among other things supports "sniffing" the Elasticsearch cluster topology.

It would be great if Flummi could build upon this officially supported way to connect to Elasticsearch.

If you're interested in this, I could probably provide a pull request implementing this (breaking) change.

joschi avatar Mar 24 '17 09:03 joschi

Sounds interesting. Is this client capable of talking to elastic 2.4 instances?

BastianVoigt avatar Apr 19 '17 08:04 BastianVoigt

@BastianVoigt In the end the low-level REST client is just a glorified HTTP client. No business-logic or Elastiscearch specifics (except for the Sniffer, which is optional) have been implemented on it.

joschi avatar Apr 19 '17 08:04 joschi

Well it has some cluster features like load balancing, connection pooling, some failover logic. https://www.elastic.co/guide/en/elasticsearch/client/java-rest/5.2/_features.html

zarucki avatar Apr 19 '17 13:04 zarucki

That sounds quite interesting. If one of you has the time to give it a try, I would happily review your pull request :)

BastianVoigt avatar Apr 20 '17 07:04 BastianVoigt

I just gave it a little try. Unfortunately the low-level rest client is not very well usable yet. It seems it doesn't support changing the timeout per-request, and also it hides Apache's HTTPRequest builder pattern behind an ugly single-method-call which is not very convenient. However the cluster load-balancing feature is promising. Needs some more love before it compiles (70 compiler errors). Pushed it to a branch "low-level-client", so if anyone has the time to finish it, please go for it :)

BastianVoigt avatar Apr 21 '17 16:04 BastianVoigt