I use a in house developed java rest client for elasticsearch. 
Unfortunately it's not in any shape to untangle from our code base and put 
on Github yet but I might consider that if there's more interest.

Basically I use apache httpclient, I implemented a simple round robin 
strategy so I can failover if nodes go down, and I implemented a simple 
rest client around this to support put/post/delete/get requests. Also added 
some basic interpretation of statuses and have mapped those to sensible 
exceptions. 

The idea is that this client is wrapped with another client that supports 
more high level APIs that are exposed from elasticsearch. So you can do 
things like index/delete documents, manage aliases, do bulk indexing etc. 
My long term goal was actually to have two implementations of that client 
one for REST and one for embedded elasticsearch. That would be an 
interesting project because it would give you choice. Except, I never got 
around to doing the embedded client implementation since we don't really 
need it so far. Something else that we use is to model the query DSL using 
static java methods and provides a simple DSL for creating queries in Java. 
This in turn uses my github jsonj project that allows you to 
programmatically manipulate json structures. 

None of this is particularly complicated but altogether there is quite a 
bit of code to write and quite a few things you can get wrong. It's always 
hard to separate the general purpose stuff from the application specific 
stuff and thats one reason why I have not yet put this code out. 

Jilles


On Wednesday, March 26, 2014 10:46:16 AM UTC+1, Subhadip Bagui wrote:
>
> Hi, 
>
> We have a cloud management framework where all the event data are to be 
> stored in elasticsearch. I have to start the client side code for this.
>  
> I need a suggestion here. Which one should I use, elasticsearch Java API 
> or REST API for the client ?
>
> Kindly suggest and mention the pros and cons for the same so it will be 
> easy for me to decide the product design than latter hassel.
>
> Subhadip
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/350caf92-63c1-4a0c-a1b5-781cb4b09cfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to