Skip to content

rore/finagle-es-proxy

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

finagle-es-proxy

See the blog post about this code here.

This is an example of using [finagle] (https://github.com/twitter/finagle) as a proxy to [Elasticsearch] (http://elasticsearch.org). It demonstrates proxying using the Elasticsearch native client, and creating an authentication layer in front of Elasticsearch.

The ESProxy object is a server (created using the cool [Twitter Server] (https://github.com/twitter/twitter-server) template) that proxies all requests to an Elasticsearch cluster. The cluster settings (hosts and cluster name) can be controlled via initialization parameters (see the [ESProxy] (https://github.com/rore/finagle-es-proxy/blob/master/src/main/scala/im/rore/ESProxy.scala) code).

Doing a simple HTTP proxy to Elasticsearch is rather trivial. But building a proxy using the Elasticsearch native client requires a little hacking. We need to pass the request to the REST controller of Elasticsearch, provide it with a mock channel to capture the response and return it in our own server.

This example also shows how to add an authentication filter to the server which can be used to secure Elasticsearch for unauthorized access.

About

A demo proxy to Elasticsearch using finagle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published