otto-de / flummi

Flummi Elastic Search HTTP REST Client
https://github.com/otto-de/flummi
Apache License 2.0
56 stars 28 forks source link

Use Elasticsearch 5.x Low-Level REST client #14

Open joschi opened 7 years ago

joschi commented 7 years ago

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.

BastianVoigt commented 7 years ago

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

joschi commented 7 years ago

@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.

zarucki commented 7 years ago

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

BastianVoigt commented 7 years ago

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

BastianVoigt commented 7 years ago

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 :)